• Home
  • University of the People
  • Data Structures (proctored course) CS 3303
  • Data Structures Review Quiz

Data Structures Review Quiz

/ Review Quiz Review Quiz Started on State Finished Completed on Time taken Marks 105.00/106.00 Grade 9.91 out of 10.00 (99.06%) Question 1 Correct Mark 1.00 out of 1.00 I Flag question An exchange sort is one where: (select the best answer) Select one: a. Records in an unsorted list are moved to a sorted list b. Adjacent records in the list and compared and exchanged c. An inversion is executed d. The sorting algorithm is said to be stable The correct answer is: Adjacent records in the list and compared and exchanged Question 2 Correct Mark 1.00 out of 1.00 A binary tree traversal that lists every node in the tree exactly once is called: IP Flag question Select one: a. a Traversal b. A visitor design pattern c. An enumeration V d. Natural ordering sequence The correct answer is: An enumeration Question 3 If A={1, 2, 3, 4} and B={4, 5, 6}, find AU B . Correct Mark 1.00 out of 1.00 P Flag question 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} v The correct answer is: {1,2,3,4,5,6} Question 4 Correct Mark 1.00 out of 1.00 Flag question For the following code fragment, select option that represents the most appropriate asymptotic analysis: for (i=0; i<n; i++) { // Search in array a for smallest element starting at i to n-1 // minIndex = findSmallestElement(a, i, n-1) a[i] = a[minIndex]; } findSmallestElement( int a[], int i, int n ) { int largest = a[i]; while(i<n) { if(a[i] >a[largest]) largest = i; i++; } return(largest); } Option 1. O(n) Option 2. 0(2") Option 3. O( n log n ) Option 4. O( n2) Select one: a. Option 1 b. Option 2 c. Option 3 d. Option 4 v index-of-smallest element in a[i .. j] takes j-i+1 operations · n + (n-1) + (n-2) + (n-3) + ... + 3 + 2 + 1 · this is n2 The correct answer is: Option 4 Question 5 Correct Mark 1.00 out of 1.00 P Flag question Question 6 Correct Mark 1.00 out of 1.00 I Flag question Question 7 Correct Mark 1.00 out of 1.00 P Flag question Question 8 Correct Mark 1.00 out of 1.00 The implementation of a data type as a data structure is the physical form of an ADT. Select one: True False The correct answer is 'True'. The upper bound for the growth of the Algorithms running time is represented by: Select one: a. Big Oh (O) v b. Big Omega (Q) c. Big Theta (O) d. Exponential growth The correct answer is: Big Oh (O) A list is Select one: a. An ADT for storing and retrieving data b. A tree data structure c. Finite ordered sequence of data items V d. A collection of operations to implement an ADT The correct answer is: Finite ordered sequence of data items A tree whose internal nodes all have exactly K children is called a K-ary tree. Select one: