Question: answer the ff Question 1 Answer either TRUE or FALSE for each of the following statements (1 mark each) a) A deleted space in a
answer the ff
Question 1 Answer either TRUE or FALSE for each of the following statements (1 mark each) a) A deleted space in a hash table cannot be reused for subsequent insertions. b) For any binary tree T, an infix traversal always outputs the values of T in sorted order c) The number of null pointers in a binary tree is always one more than the number of nodes. d) The depth of a binary tree is equivalent to its height. e) The minimum depth of a binary search tree is O(n/2). fThe maximum depth of a binary search tree is only realized if elements are inserted in sorted order g) For each insertion, at most one rotation (single or double) is required to rebalance an AVL tree. h) The maximum depth for both the AVL and red-black trees is O(log n). a) (2 marks) Explain why the following array does not satisfy the properties of a binary heap (assuming larger values have a higher priority). 50 10 90 80 70 40 30 20 b) (4 marks) Transform the above array using BuildHeap into a binary heap (assuming that smaller values have a higher priority). Show each step of your solution. Ilustrate the difference between each of the following pairs of concepts (4 marks each): a) Static data member and instance data member b) Virtual method and abstract method c) Rectangular array and jagged array d) Composition and inheritance e Shallow copy and deep copy Question 1 Answer either TRUE or FALSE for each of the following statements (1 mark each) a) A deleted space in a hash table cannot be reused for subsequent insertions. b) For any binary tree T, an infix traversal always outputs the values of T in sorted order c) The number of null pointers in a binary tree is always one more than the number of nodes. d) The depth of a binary tree is equivalent to its height. e) The minimum depth of a binary search tree is O(n/2). fThe maximum depth of a binary search tree is only realized if elements are inserted in sorted order g) For each insertion, at most one rotation (single or double) is required to rebalance an AVL tree. h) The maximum depth for both the AVL and red-black trees is O(log n). a) (2 marks) Explain why the following array does not satisfy the properties of a binary heap (assuming larger values have a higher priority). 50 10 90 80 70 40 30 20 b) (4 marks) Transform the above array using BuildHeap into a binary heap (assuming that smaller values have a higher priority). Show each step of your solution. Ilustrate the difference between each of the following pairs of concepts (4 marks each): a) Static data member and instance data member b) Virtual method and abstract method c) Rectangular array and jagged array d) Composition and inheritance e Shallow copy and deep copy
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
