InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What is the fundamental operation performed in skew heaps?(a) intersection(b) difference(c) merging(d) sortingThis interesting question is from Heap in section Heap of Data Structures & Algorithms II have been asked this question during an online interview. |
|
Answer» Right answer is (C) merging |
|
| 2. |
What is the time per operation of merging, insertion and deletion operations in a skew heap?(a) O(N)(b) O(log N)(c) O(N log N)(d) O(N^2)I need to ask this question from Heap topic in division Heap of Data Structures & Algorithms IThis question was posed to me during an interview. |
|
Answer» Correct ANSWER is (b) O(log N) |
|
| 3. |
Why would a recursive implementation fail in skew heaps?(a) skew heaps are self adjusting(b) efficiency gets reduced(c) lack of stack space(d) time complexityMy query is from Heap topic in portion Heap of Data Structures & Algorithms IThe question was posed to me in class test. |
|
Answer» Correct ANSWER is (c) lack of stack SPACE |
|
| 4. |
Which of the following is difficult to determine the right path length?(a) Skew heaps(b) Binomial tree(c) Leftist heap(d) d-heapI need to ask this question from Heap topic in division Heap of Data Structures & Algorithms II got this question in class test. |
|
Answer» Correct option is (a) Skew heaps |
|
| 5. |
The worst case analysis for a naïve merge is given as?(a) O(N)(b) O( log N)(c) O( N log N)(d) O(N^2)This interesting question is from Heap in portion Heap of Data Structures & Algorithms IThe question was posed to me during an online interview. |
|
Answer» Right choice is (a) O(N) |
|
| 6. |
How many types of the merge are available in skew heaps?(a) 1(b) 2(c) 3(d) 4I want to ask this question from Heap topic in chapter Heap of Data Structures & Algorithms IThis question was posed to me in my homework. |
|
Answer» The CORRECT answer is (B) 2 |
|
| 7. |
What is the amortized efficiency of skew merge?(a) O(N)(b) O( log N)(c) O( N log N)(d) O(N^2)Question is from Heap in chapter Heap of Data Structures & Algorithms IThis question was posed to me during an interview for a job. |
|
Answer» CORRECT option is (b) O( log N) The best explanation: The AMORTIZED efficiency of a skew heap is mathematically FOUND to be O( log N). |
|
| 8. |
In skew heaps, certain constraints are to be met in order to perform swapping.(a) true(b) falseThis question is from Heap in section Heap of Data Structures & Algorithms II have been asked this question during an interview. |
|
Answer» The correct choice is (b) false |
|
| 9. |
Descending priority queue can be implemented using ______(a) max heap(b) min heap(c) min-max heap(d) trieMy question is based upon Heap topic in section Heap of Data Structures & Algorithms II had been asked this question during an interview for a job. |
|
Answer» The correct choice is (a) MAX heap |
|
| 10. |
Min heap can be used to implement selection sort.(a) True(b) FalseThis key question is from Heap topic in chapter Heap of Data Structures & Algorithms IThis question was posed to me during an internship interview. |
|
Answer» Right option is (a) True |
|
| 11. |
The ascending heap property is ___________(a) A[Parent(i)] =A[i](b) A[Parent(i)] = A[i](d) A[Parent(i)] > 2 * A[i]My doubt is from Heap in portion Heap of Data Structures & Algorithms II have been asked this question in unit test. |
|
Answer» Right answer is (b) A[PARENT(i)] <= A[i] |
|
| 12. |
The procedure FindMin() to find the minimum element and the procedure DeleteMin() to delete the minimum element in min heap take _________(a) logarithmic and linear time constant respectively(b) constant and linear time respectively(c) constant and quadratic time respectively(d) constant and logarithmic time respectivelyThe origin of the question is Heap topic in chapter Heap of Data Structures & Algorithms IThis question was posed to me in exam. |
|
Answer» The correct option is (d) constant and logarithmic TIME respectively |
|
| 13. |
Which one of the following array elements represents a binary min heap?(a) 12 10 8 25 14 17(b) 8 10 12 25 14 17(c) 25 17 14 12 10 8(d) 14 17 25 10 12 8My enquiry is from Heap topic in section Heap of Data Structures & Algorithms IThis question was posed to me in an interview. |
|
Answer» RIGHT option is (b) 8 10 12 25 14 17 To explain: A tree is MIN heap when data at every node in the tree is smaller than or equal to it’s children’ s data. So, only 8 10 12 25 14 17 generates REQUIRED tree. |
|
| 14. |
In a binary min heap containing n elements, the largest element can be found in __________ time.(a) O(n)(b) O(nlogn)(c) O(logn)(d) O(1)The doubt is from Heap in portion Heap of Data Structures & Algorithms IThe question was asked in an online interview. |
|
Answer» Right answer is (a) O(n) |
|
| 15. |
Min heap is a complete binary tree.(a) True(b) FalseMy question comes from Heap topic in portion Heap of Data Structures & Algorithms IThis question was addressed to me by my school teacher while I was bunking the class. |
|
Answer» Right option is (a) True |
|
| 16. |
What will be the position of 5, when a max heap is constructed on the input elements 5, 70, 45, 7, 12, 15, 13, 65, 30, 25?(a) 5 will be at root(b) 5 will be at last level(c) 5 will be at second level(d) 5 can be anywhere in heapI would like to ask this question from Heap topic in division Heap of Data Structures & Algorithms IThe question was posed to me during an online interview. |
|
Answer» Right option is (b) 5 will be at last level |
|
| 17. |
The relationship of skew heaps to leftist heaps is analogous to that of?(a) Splay tree and AVL tree(b) Red black tree and AVL tree(c) Binary tree and Splay tree(d) Binary tree and Red black treeThe origin of the question is Heap topic in chapter Heap of Data Structures & Algorithms IThe question was asked during an internship interview. |
|
Answer» Right CHOICE is (a) SPLAY tree and AVL tree |
|
| 18. |
What is the amortized cost per operation of a skew heap?(a) O(N)(b) O(N log N)(c) O(N^2)(d) O(log N)My question is from Heap in division Heap of Data Structures & Algorithms IThe question was asked in quiz. |
|
Answer» The correct choice is (d) O(log N) |
|
| 19. |
The worst case running time of all operations in a skew heap is given as?(a) O(N)(b) O(N log N)(c) O(N^2)(d) O(M log N)My query is from Heap topic in section Heap of Data Structures & Algorithms IThe question was posed to me in an online interview. |
|
Answer» The correct answer is (a) O(N) |
|
| 20. |
___________ is a self-adjusting version of a leftist heap.(a) Rightist heap(b) Skew heap(c) d-heap(d) Binary heapThis interesting question is from Heap in portion Heap of Data Structures & Algorithms II had been asked this question during an interview for a job. |
|
Answer» CORRECT option is (b) Skew HEAP The BEST I can EXPLAIN: A skew heap is a self-adjusting version of a LEFTIST heap and it is simpler to implement. |
|
| 21. |
In what time can a leftist heap be built?(a) O(N)(b) O(N log N)(c) O(log N)(d) O(M log N)The query is from Heap topic in portion Heap of Data Structures & Algorithms IThe question was asked in a job interview. |
|
Answer» Right CHOICE is (a) O(N) |
|
| 22. |
What is the time taken to delete a minimum element in a leftist heap?(a) O(N)(b) O(N log N)(c) O(log N)(d) O(M log N)My enquiry is from Heap in portion Heap of Data Structures & Algorithms IThis question was posed to me in my homework. |
|
Answer» Correct ANSWER is (c) O(log N) |
|
| 23. |
What happens if the null path length is not updated?(a) error occurs(b) all null path lengths will be 0(c) all null path lengths will be -1(d) all null path lengths will be 1My query is from Heap topic in division Heap of Data Structures & Algorithms II had been asked this question in an online interview. |
|
Answer» RIGHT choice is (b) all null path lengths will be 0 Explanation: While performing insertion VIA merge OPERATION in a leftist HEAP, if the null path length is not updated, all null path lengths will be 0. |
|
| 24. |
What would be the result if the left subtree of the root has a null path length of 1 and the right subtree has a null path length of 2?(a) merge occurs without violation(b) violation at left subtree(c) violation at right subtree(d) violation at the rootMy question comes from Heap in chapter Heap of Data Structures & Algorithms II got this question during an interview. |
|
Answer» Correct answer is (d) violation at the root |
|
| 25. |
In a leftist heap, all the operations should be performed on?(a) left path(b) centre path(c) right path(d) rootThis intriguing question comes from Heap in portion Heap of Data Structures & Algorithms IThe question was asked in unit test. |
|
Answer» The correct answer is (c) RIGHT PATH |
|
| 26. |
Why is this heap named leftist heap?(a) only left subtrees exist(b) the tree is biased to get deep down the left(c) it is balanced(d) right trees are unbalancedThe origin of the question is Heap topic in chapter Heap of Data Structures & Algorithms II got this question in my homework. |
|
Answer» Right option is (B) the tree is biased to GET DEEP down the left |
|
| 27. |
What is the node path length of a node with 0 or 1 child?(a) 1(b) -1(c) 0(d) nullThe query is from Heap in chapter Heap of Data Structures & Algorithms IThis question was addressed to me in an interview for internship. |
|
Answer» The correct answer is (C) 0 |
|
| 28. |
What is the efficiency of merge used in leftist heaps?(a) O(N)(b) O(N log N)(c) O(M log N)(d) O(log N)Origin of the question is Heap topic in division Heap of Data Structures & Algorithms IThe question was posed to me in an interview for job. |
|
Answer» Correct answer is (d) O(LOG N) |
|
| 29. |
A leftist heap is also said to be a binary heap.(a) true(b) falseMy question comes from Heap topic in chapter Heap of Data Structures & Algorithms II have been asked this question in final exam. |
|
Answer» The correct answer is (a) true |
|
| 30. |
What is the fundamental operation on leftist heap?(a) insertion(b) merging(c) deletion(d) swappingMy question is taken from Heap topic in section Heap of Data Structures & Algorithms IThis question was addressed to me in a job interview. |
|
Answer» The correct option is (b) merging |
|
| 31. |
Which of the following operations does not destroy the leftist heap property?(a) insert(b) merge(c) delete(d) swapThe query is from Heap topic in portion Heap of Data Structures & Algorithms IThis question was addressed to me in class test. |
|
Answer» The correct ANSWER is (c) delete |
|
| 32. |
How many nodes does a leftist tree with r nodes must have?(a) 2^r(b) 2^r-1(c) 2r(d) 2r-1My doubt is from Heap in section Heap of Data Structures & Algorithms II got this question in an interview. |
|
Answer» Correct answer is (B) 2^r-1 |
|
| 33. |
In a leftist heap, the null path length of a null node is defined as?(a) 0(b) 1(c) null(d) -1I'm obligated to ask this question of Heap topic in chapter Heap of Data Structures & Algorithms IThis question was posed to me in an interview for internship. |
|
Answer» Correct choice is (d) -1 |
|
| 34. |
How many properties does a leftist heap support?(a) 1(b) 2(c) 3(d) 4This interesting question is from Heap topic in division Heap of Data Structures & Algorithms II got this question in homework. |
|
Answer» Correct choice is (c) 3 |
|
| 35. |
Pointer manipulation is generally more time-consuming than multiplication and division.(a) true(b) falseMy doubt is from Heap topic in section Heap of Data Structures & Algorithms II have been asked this question in class test. |
|
Answer» The CORRECT answer is (a) true |
|
| 36. |
What is the run time efficiency of an insertion algorithm?(a) O(N)(b) O(log N)(c) O(N^2)(d) O(M log N)My doubt stems from Heap topic in section Heap of Data Structures & Algorithms IThis question was addressed to me in my homework. |
|
Answer» The CORRECT option is (a) O(N) |
|
| 37. |
Out of the following given options, which is the fastest algorithm?(a) fibonacci heap(b) pairing heap(c) d-ary heap(d) binary heapMy enquiry is from Heap in section Heap of Data Structures & Algorithms IThis question was posed to me in a job interview. |
|
Answer» Correct option is (a) fibonacci heap |
|
| 38. |
The amortized time efficiency for performing deletion of a minimum element is?(a) O(N)(b) O(log N)(c) O(N^2)(d) O(M log N)I need to ask this question from Heap in chapter Heap of Data Structures & Algorithms II have been asked this question in semester exam. |
|
Answer» The CORRECT answer is (b) O(log N) |
|
| 39. |
The roots of the elements of the subtrees are smaller than the root of the heap.(a) True(b) FalseThis intriguing question originated from Heap in chapter Heap of Data Structures & Algorithms II have been asked this question in homework. |
|
Answer» Correct CHOICE is (B) False |
|
| 40. |
Pairing heaps time complexity was inspired by that of?(a) splay tree(b) treap(c) red-black tree(d) avl treeMy query is from Heap in division Heap of Data Structures & Algorithms IThis question was posed to me in an international level competition. |
|
Answer» Correct ANSWER is (a) splay tree |
|
| 41. |
Which of the following methods is the best choice for complex applications?(a) binary heap(b) d-heap(c) treap(d) pairing heapMy question comes from Heap topic in section Heap of Data Structures & Algorithms II have been asked this question during an interview for a job. |
|
Answer» The correct option is (d) pairing HEAP |
|
| 42. |
If there are c children of the root, how many calls to the merge procedure is required to reassemble the heap?(a) c(b) c+1(c) c-1(d) 1Asked question is from Heap in division Heap of Data Structures & Algorithms IThis question was addressed to me in class test. |
|
Answer» Correct ANSWER is (C) c-1 |
|
| 43. |
What is the basic operation performed in a pairing heap?(a) merge(b) deletion(c) insertion(d) swappingI'm obligated to ask this question of Heap topic in portion Heap of Data Structures & Algorithms II have been asked this question by my school principal while I was bunking the class. |
|
Answer» Right choice is (a) merge |
|
| 44. |
Which of the heaps is implemented by the following figure?(a) fibonacci heaps(b) pairing heap(c) skew heap(d) leftist heapThe above asked question is from Heap in portion Heap of Data Structures & Algorithms IThis question was addressed to me in quiz. |
|
Answer» CORRECT answer is (b) PAIRING heap The best I can explain: The above figure is a REPRESENTATION of a pairing heap because it has LEFT CHILDREN and right siblings. |
|
| 45. |
Which node contains a pointer to its parent?(a) root node(b) right most child(c) left most child(d) left siblingMy enquiry is from Heap topic in portion Heap of Data Structures & Algorithms IThis question was posed to me during an internship interview. |
|
Answer» Correct option is (c) left most child |
|
| 46. |
How is a pairing heap represented?(a) binary tree(b) fibonacci tree(c) heap ordered tree(d) treapThis intriguing question comes from Heap in portion Heap of Data Structures & Algorithms IThe question was posed to me in semester exam. |
|
Answer» The CORRECT choice is (c) heap ordered TREE |
|
| 47. |
What is the reason for the efficiency of a pairing heap?(a) simplicity(b) time-efficient(c) space-efficient(d) advancedI'd like to ask this question from Heap in division Heap of Data Structures & Algorithms IThe question was asked during an online interview. |
|
Answer» The CORRECT OPTION is (a) SIMPLICITY |
|
| 48. |
Which of the following is the application of minimum ternary heap?(a) Prim’s Algorithm(b) Euclid’s Algorithm(c) Eight Queen Puzzle(d) TreeEnquiry is from Ternary heap in section Heap of Data Structures & Algorithms II got this question during an interview. |
|
Answer» The CORRECT option is (a) Prim’s ALGORITHM |
|
| 49. |
What is the time complexity for creating a ternary heap using swapping?(a) O (log n/ log 3)(b) O (n!)(c) O (n)(d) O (1)The question is from Ternary heap in chapter Heap of Data Structures & Algorithms IThe question was posed to me in class test. |
|
Answer» The correct answer is (C) O (n) |
|
| 50. |
Do ternary heap have better memory cache behavior than binary heap.(a) True(b) FalseThis intriguing question originated from Ternary heap topic in section Heap of Data Structures & Algorithms IThis question was addressed to me in a national level competition. |
|
Answer» The correct choice is (a) True |
|