Reference no: EM13336646
Task 1.2 Prove this fact rigorously, by mathematical induction.
Please note that the last permutation produced in this sequence is (n, ..., 2, 1). And this is the only permutation that does not have the "next" permutation to it.
Example. Below is the sequence of permutations for n = 3, produced by applying nextPermutation consecutively:
(1 2 3); (1 3 2); (3 1 2); (2 1 3); (2 3 1); (3 2 1)
So, the nextPermutation applied to (1 , 2, 3) produces (1, 3, 2),
applied to (1 , 3, 2) it produces (3, 1, 2),
applied to (3, 1, 2) it produces (2, 1, 3),
etc.
Task 2.2. Iterative version. This is a difficult task, although awarded only two marks.
Using the recursive algorithm, described in the previous section, develop an iterative function with the same functionality as the recursive nextPermutation function. Recall, that the iterative function should not contain recursive calls - it uses only looping constructs.
Task 3. Adding counters to the sorting functions. Develop modified versions of the quickSort and mergeSort functions discussed in the lectures.
I.e. you need to add integer counters to the sorting methods that count the number of comparisons made by each of the functions during the sorting process.
Depict lewis structure of no3cl include lone pairs
: Draw lewis structure of NO3Cl include lone pairs of electrons, resonance structures and formal charges (minimized). The basic structure is O=N(-O)(-O-Cl). Where N is double bonded to one O and single bonded to two O atoms. Also, one of the O atoms..
|
How does brakes affect the time required to come to a stop
: Assume that the brakes in your car create a constant deceleration, regardless of how fast you are going. If you double your driving speed, how does this affect the time required to come to a stop
|
Calculate the pressure exerted on the floor by the heel
: As a woman walks, her entire weight is momentarily placed on one heel of her high-heeled shoes. Calculate the pressure exerted on the floor by the heel
|
How do you calculate the molarity of kmno4
: How do you calculate the molarity of KMnO4 after it has been titrated by .0505 M (COOH)2? The only information you are given is .0011 mol of KMnO4 and no volume...this is for prelab 6.
|
Develop modified versions of the quicksort and mergesort
: Using the recursive algorithm, described in the previous section, develop an iterative function with the same functionality as the recursive nextPermutation function. Recall, that the iterative function should not contain recursive calls - it uses..
|
Explain the sedimentation coefficient of a certain dna
: The sedimentation coefficient of a certain DNA in 1 M NaCl at 20 oC was measured by boundary sedimentation at 24,630 rpm. The following data were recorded time (min) distance (cm) 16 6.2687 32 6.3507 48 6.4380 64 6.5174 80 6.6047 96 6.6814 A.
|
What is the acceleration of the system
: Two masses, m1 and m2 are connected by a cord and hang straight down from either side of a light frictionless pulley. What is the acceleration of the system
|
Calculate the electric potential half way between two rings
: For two concentric conducting rings, the inner radius of the larger ring is 12.0 cm and the outer radius of the smaller ring is 4.0 cm. The electric potential of the inner ring is 0 and that of the outer ring is 10 V.
|
Calculate the refractive power of a magnifying glass
: A stamp collector is viewing a stamp with a magnifying glass held next to her eye. Her near point is 22 cm from her eye. What is the refractive power of a magnifying glass that has an angular magnification of 6.32 when the image of the stamp is loca..
|