Title | ALL Quizzes CS3303 - PRACTICE QUIZ MATERIAL |
---|---|
Course | Data Structures (proctored course) |
Institution | University of the People |
Pages | 137 |
File Size | 2.7 MB |
File Type | |
Total Downloads | 49 |
Total Views | 151 |
PRACTICE QUIZ MATERIAL...
https://www.calltutors.com/Quiz/Data-Structure
A solution is said to be efficient if it: Select one: a. Solves the problem within the required resource constraints
b. Executes faster than other solutions c. Is completed in the fewest number of steps d. Can be explained in the context of Big-Oh notation Feedback The correct answer is: Solves the problem within the required resource constraints
Question 2 Correct Mark 1.00 out of 1.00
Flag question Question text
An ADT is: Select one: a. A type together with a collection of operations to manipulate the type b. An implementation of a flyweight design pattern c. The realization of a data type as a software component
d. An implementation in java of a class for a data type Feedback The correct answer is: The realization of a data type as a software component
Question 3 Correct Mark 1.00 out of 1.00
Flag question Question text
The implementation of a data type as a data structure is the physical form of an ADT. Select one: True
False Feedback The correct answer is 'True'.
Question 4 Correct Mark 1.00 out of 1.00
Flag question Question text
Which of the following is NOT one of the design patterns outlined in our text. Select one: a. Flyweight b. Visitor c. Composite d. Synergy
Feedback The correct answer is: Synergy
Question 5 Correct Mark 1.00 out of 1.00
Flag question Question text
If A={1, 2, 3, 4} and B={4, 5, 6}, find A∪ B . Select one: a. {1,2,3,4,4,5,6} b. {4} c. {x | x is all positive integers} d. {1,2,3,4,5,6}
Feedback The correct answer is: {1,2,3,4,5,6}
Question 6 Correct Mark 1.00 out of 1.00
Flag question Question text
According to the properties of logarithms, log(nm) = Note: Due to issues with HTML formatting, an exponent is represented by preceding it with the ^ symbol. As such x^2 is equivalent to x2. Select one: a. log n – log m b. n log n c. log n + log m
d. log(n^m) Feedback The correct answer is: log n + log m
Question 7 Correct Mark 1.00 out of 1.00
Flag question Question text
Recursion is when an algorithm uses a series of loop structures to repeat an operation until the answer has been computed. Select one: True False
Feedback The correct answer is 'False'.
Question 8 Correct Mark 1.00 out of 1.00
Flag question Question text
Which of the following is not a mathematical proof technique? Select one: a. Proof by mathematical induction b. Proof by contradiction c. Direct proof d. Proof by consensus
Feedback The correct answer is: Proof by consensus
Question 9
Correct Mark 1.00 out of 1.00
Flag question Question text
Which of the following is not a characteristic of an algorithm? Select one: a. It must be correct b. It must be composed of concrete steps c. It can have no ambiguity d. It must be composed of an infinite number of steps.
Feedback The correct answer is: It must be composed of an infinite number of steps.
The upper bound for the growth of the Algorithms running time is represented by: Select one: a. Big Oh (O)
b. Big Omega (Ω) c. Big Theta (Θ) d. Exponential growth Feedback The correct answer is: Big Oh (O)
Question 2 Correct Mark 1.00 out of 1.00
Flag question
Question text
Asymptotic Algorithm Analysis is primarily concerned with: Select one: a. The size of the constant in the algorithm running time equation b. The speed of the computing running the algorithm c. The speed of the compiler d. The growth rate demonstrated in the algorithm running time equation
Feedback The correct answer is: The growth rate demonstrated in the algorithm running time equation
Question 3 Correct Mark 1.00 out of 1.00
Flag question Question text
True/False: Big Theta (Θ) indicates that the Upper and Lower bounds of an algorithm are the same. Select one: True
False Feedback The correct answer is 'True'.
Question 4 Correct Mark 1.00 out of 1.00
Flag question Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis: for (int i = 0; i < a.length; i++) { System.out.println(a[i]); } Option 1. O( n ) Option 2.
O( 2n )
Option 3.
O( n log n )
Option 4.
O( n2 )
Select one: a. Option 1
b. Option 2 c. Option 3 d. Option 4 Feedback The correct answer is: Option 1
Question 5 Correct Mark 1.00 out of 1.00
Flag question Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis: for (int i = 1; i 0) { return a[a.length - 1]; } else { throw new NoSuchElementException(); } Option 1. O( 1 ) Option 2.
O( 2n )
Option 3.
O( n log n )
Option 4. Select one: a. Option 1
b. Option 2 c. Option 3 d. Option 4
O( n2 )
Feedback Explanation: Here n = a.length, and T(n) = 1. The correct answer is: Option 1
Question 7 Correct Mark 1.00 out of 1.00
Flag question Question text
For the following code fragment, select the most appropriate asymptotic analysis: // Towers of Hanoi static void solveHanoi(int disks, char fromPole, char toPole, char withPole) { if (disks >= 1) { solveHanoi(disks-1, fromPole, withPole, toPole); moveDisk(fromPole, toPole); solveHanoi(disks-1, withPole, toPole, fromPole); } } static void moveDisk(char fromPole, char toPole) { moves++; } Option 1. O( n ) Option 2.
O( 2n )
Option 3.
O( n log n )
Option 4.
O( n2 )
Select one: a. Option 1 b. Option 2
c. Option 3 d. Option 4 Feedback The correct answer is: Option 2
Question 8 Correct Mark 1.00 out of 1.00
Flag question Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis: public static int binarySearch(int[] a, int key) { int left = 0; int right = a.length-1; while (left a[mid]) left = mid+1; else return mid; } //not found return -1; } Option 1. Ω( 1 ), O( log n ) Option 2.
Ω( n ), O( 2n )
Option 3.
Θ( n log n )
Option 4.
Θ( log n )
Select one: a. Option 1
b. Option 2 c. Option 3 d. Option 4 Feedback The correct answer is: Option 1
Question 9 Correct Mark 1.00 out of 1.00
Flag question Question text
For the following code fragment, select option that represents the most appropriate asymptotic analysis: for (i=0; i= 1) { solveHanoi(disks-1, fromPole, withPole, toPole); moveDisk(fromPole, toPole); solveHanoi(disks-1, withPole, toPole, fromPole); } } static void moveDisk(char fromPole, char toPole) { moves++; } Option 1.
O( n )
Option 2.
O( 2n )
Option 3.
O( n log n )
Option 4.
O( n2 )
Select one: a. Option 1 b. Option 2
c. Option 3 d. Option 4 Feedback The correct answer is: Option 2
Question 11 Correct Mark 1.00 out of 1.00
Flag question Question text
If A={1, 2, 3, 4} and B={4, 5, 6}, find A∪ B . Select one: a. {1,2,3,4,4,5,6} b. {4} c. {x | x is all positive integers} d. {1,2,3,4,5,6}
Feedback The correct answer is: {1,2,3,4,5,6}
Question 12 Correct Mark 1.00 out of 1.00
Flag question Question text
For the following code fragment, select the option that represents the most appropriate asymptotic analysis: for (int i = 1; i...