Question: Data structure Answer all please. I am not sure about the answers. So please. Answer all. Thanks. 19 Which of the following is a reason
19 Which of the following is a reason to use an armay instead of an ArrayList? a An array has faster access to its elements than does an ArmayL.ist b. An array knows it length, but an ArrayList docsnt know its length. An Array List can allocate more space than it nceds 40 Heap sort is found to be very efficient a with regard to the storage requirement b. in time consumption c. regarding overheads involved d. None of the above 41. One difference between a queue and a stack is Queues require dynamic memory, but stacks do not. b Stacks require dynamic memory, but queses do not s Queues use two ends of the structure; stacks use only one. d. Stacks use two ends of the structure,queues use only one 42. The terms push and pop are related to which data stnucture a Armay b. Stack c. List d. All of the above. 43. A binary tree whose every node has either nero or two children is called a. A full binary tree b. A binary scarch tree c. An extended binary tree of the above. 44. Consider the following code segment Arraytis String1ist -new Arraylist Stringp1 list.add0*) list.addtR) list.aet 12. 1ist.add (2, liat.addtu System.out.printin(list What is printed as a result of executing the code segment? C. P, Q, T, S, u) 45. In an array implementation of a binary heap, what is the formula to calculate the index of the right child of the element with indes i a. 211 b. 212 d, i / 2 46. In a min-heap the smallest key is in a the root b. a leaf c. a node. d. None of the above a. Both have the same average case complexity b. Both are recursive. 47. Which is true of merge sort and quicksor? c Both take O(n) to divide the problem or combine the pieces d. All of the above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
