-
Overview The purpose of this assignment is to practice functional programming in the Racket Programming Language and to also reinforce the notion of the list as a universal data structure, by implementing various operations on binary search trees. Specification A binary search tree is a binary tree which satisfies the following invariant property: for any node X, every node in X's left subtree has a value smaller than that of X, and every node in X's right subtree has a...
-
Write down how the expression (A-B) V - (CA D)A (E-F) of wffs (an example is given below): Example: The expression (A A-B) V (CD) 1. A is a wff (propositional variable) 2. B is a wff (propositional variable 3. -B is a wff (obtained by applying to 2) 4. AA-B is a wff (obtained by applying A to 1 and 3) 5. (AA-B) is a wff (obtained by applying parentheses to 4) 6. C is a wff (propositional variable)...
-
use the example to answer
8,9,10&11
Here's an example: Balance the following redox reaction, which occurs in acidic solution: Fe (aq)+ MnO4'(aq) -Fe (aq) + Mn (aq) Solution: +2 +7 +3 Step 1) +2 Fe2 (aq)+ MnOa (aq) Fe(aq) + Mn2 (aq) Fe (aq) MnO4 (aq) Mn2 (aq) 1 Fe on each side; 1 Mn on each side; no adjustment necessary Fe2 (aq) Fe 3'(aq) + e 5 e + MnO4(aq) Fe (aq) Fe (aq) + e (2+ on each...
-
Please write a JAVA program according to following
requirement. Thanks
Part 2 -Arrays We can use the Math.random method to generate random integers. For example, Math.random () generates a random integer greater than or equal to 0 and less than 1. The expression Math. random) 6generates random numbers between 0 and 5, simulating the throw of a die. In this lab assignment, you will use an array to test whether the random generator is fair; that is, whether each possible...
-
3.5 max number
We will pass in a list of numbers your job is to find the
largest number in that list and outputted it’s index , not the
actual value
# Get our numbers from the command line import sys 4 numbers sys.argv[1].split',') Collagse) Challenges 5 numbers int(i) for i in numbers] 3. 5. Max number # Your code goes here We will pass in a list of numbers. Your job is to find the largest number in that...
-
Use log, 3 * 0.583, log, 5 0.821, and log, 7. 1.064 to approximate the value of the given logarithm to 3 decimal places. Assume thath > 0 and b + 1. log) 21 5. Write the logarithmic expression as a single logarithm with coefficient 1, and simplify as much possible. Assume that all variable expressions represent positive real numbers. log, (v) + log2 (x2 - 9) – log2 ( +3) - Write the logarithmic expression as a single logarithm...
-
3. (8 points) Using the implementation of binary search tree operations we discussed in class, draw the trees that result from the following operations: (a) Inserting 142, 400, 205, 127, 100, 320, 160, 141, and 110 into an initially-empty tree (in that order). (b) Deleting 142 from the tree you drew for part (a). 4. (8 points) Draw the unique binary tree that has a preorder traversal of 4, 1, 6, 3, 7, 5, 9, 2, 8 and an inorder...
-
For this assignment we are going to create the beginnings of a
simple Grade Book. We will revisit this assignment again once we
learn some new concepts. For the purposes of this grade book you
should first provide a menu with the following options:
1. Add a new course
2. Add a new student
3. Add a student to a course
4. Add grades for a student in a course
5. Print a list of all grades for a student...
-
PYTHON REQUIRED
Bonus (4 points): Why was 6 afraid of 7? Because 7 89! Actually, this is mathematically impossible. "Cannibal numbers" as they're called can only eat numbers that are smaller than them, or the same size. After eating another number, the number that gets eaten disappears, and the number that ate them increases by 1 For example, given the following set of numbers, let's pretend that 9 is the cannibal. 127, 9,3, 8, 11] 9 could start by eating...
-
I really need help with this python programming assignment
Program Requirements
For part 2, i need the following functions
• get floats(): It take a single integer argument and
returns
a list of floats. where it was something like this
def get_floats(n):
lst = []
for i in range(1,n+1):
val = float(input('Enter float
'+str(i)+': '))
lst.append(val)
return lst
• summer(): This non-void function takes a single list argument,
and returns the sum of the
list. However, it does not use...