• Home
  • University of the People
  • Data Structures (proctored course) CS 3303
  • Understanding Tree Data Structures and Asymptotic Analysis

Understanding Tree Data Structures and Asymptotic Analysis

Question 5 Incorrect Mark 0.00 out of 1.00 A tree data structure whose shape obeys the following definition, o A node contains one or two keys o Every internal node has either 2 children if it contains 1 key or 3 children if it contains two keys o All leaves are at the same level in the tree Is called a/an: Select one: x a. B *- Tree b. BST B+-Tree d. 2-3 tree The correct answer is: 2-3 tree Question 6 Incorrect Mark 0.00 out of 1.00 A leaf is any node that: Select one: a. Has one child b. Is an internal node with no ancestors x O c. Is any node with two empty children d. Is the ancestor of the root node The correct answer is: Is any node with two empty children Question 7 Incorrect Mark 0.00 out of 1.00 Which of the following items is NOT true for Array-Based Lists (please select the best choice): Choice 1. Insertion and deletion operations are ® ( n ) Choice 2. Direct access of an item in the array is @( 1 ) Choice 3. Space used grows dynamically as the array is populated Choice 4. Array contains wasted space if array positions are not full Select one: a. Choice 1 × b. Choice 2 c. Choice 3 d. Choice 4 The correct answer is: Choice 3 Question 8 Incorrect Mark 0.00 out of 1.00 For the following code fragment, select the choice which represents the most appropriate asymptotic analysis: function ( n ) { sum2 = 0; for (i=1; i <= n; i++) for (j=1; j <= i; j++) sum2++; } } Choice 1. 2(1) Choice 2. O( 2" ) Choice 3. O( n2 ) Choice 4. 2( n2) (NOTE: code fragment is not intended to be functioning code) Select one: a. Choice 1 x b. Choice 2 c. Choice 3 d. Choice 4 The correct answer is: Choice 3