Explore topic-wise InterviewSolutions in .

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.

Is it possible to perform a split operation on a string in the rope if the split point is in the middle of the string.(a) True(b) FalseI'm obligated to ask this question of Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms II got this question during an internship interview.

Answer» RIGHT answer is (a) True

Easiest explanation - In order to perform the splitting on the rope data STRUCTURE, ONE can split the given string into two new string S1 and S2 in O (log n) time. So, the time complexity for worst case is O (log n). The split operation can be performed if the split point is either at the end of the string or in the middle of the string.
2.

What is the time complexity for deleting the string to form a new string in the rope data structure?(a) O (n^2)(b) O (n!)(c) O (log n)(d) O (1)This is a very interesting question from Binary Trees in portion Binary Trees of Data Structures & Algorithms IThis question was posed to me in my homework.

Answer»

Correct choice is (c) O (log N)

For EXPLANATION: In order to perform the deletion on the rope DATA structure, ONE can delete the given string at any position x to form a new string in O (log n) time. So, the time complexity for worst case is O (log n). This can be done by TWO split operations and one concatenation operation.

3.

Is insertion and deletion operation faster in rope than an array?(a) True(b) FalseThis intriguing question originated from Binary Trees topic in section Binary Trees of Data Structures & Algorithms II got this question in an interview for job.

Answer»

Right choice is (a) True

Best EXPLANATION: In order to PERFORM the insertion on the ROPE data structure, the time complexity is O (log n). In order to perform the deletion on the rope data structure, the time complexity for worst CASE is O (log n). While for ARRAYS the time complexity is O (n).

4.

What is the time complexity for inserting the string and forming a new string in the rope data structure?(a) O (log n)(b) O (n!)(c) O (n^2)(d) O (1)The above asked question is from Binary Trees topic in section Binary Trees of Data Structures & Algorithms IThe question was asked by my school principal while I was bunking the class.

Answer» RIGHT option is (a) O (log n)

For explanation: In ORDER to perform the INSERTION on the rope data structure, one can insert the given string at any position X to form a new string in O (log n) time. So, the time complexity for worst case is O (log n). This can be done by one SPLIT operation and two concatenation operations.
5.

Which type of binary tree does rope require to perform basic operations?(a) Unbalanced(b) Balanced(c) Complete(d) FullMy question is taken from Binary Trees topic in division Binary Trees of Data Structures & Algorithms IThe question was posed to me during an online interview.

Answer»

The correct OPTION is (b) Balanced

The best I can explain: To perform the BASIC operations on a ROPE DATA structure like insertion, deletion, concatenation and SPLITTING, the rope should be a balanced tree. After performing the operations one should again re-balance the tree.

6.

What is the time complexity for splitting the string into two new string in the rope data structure?(a) O (n^2)(b) O (n!)(c) O (log n)(d) O (1)This intriguing question comes from Binary Trees topic in portion Binary Trees of Data Structures & Algorithms II got this question in final exam.

Answer»

Correct choice is (c) O (log n)

To explain: In order to perform the splitting on the rope data structure, one can SPLIT the given STRING into two new string S1 and S2 in O (log n) TIME. So, the time complexity for worst case is O (log n).

7.

What is the time complexity for creating a new node and then performing concatenation in the rope data structure?(a) O (log n)(b) O (n!)(c) O (n^2)(d) O (1)This interesting question is from Binary Trees topic in portion Binary Trees of Data Structures & Algorithms IThe question was posed to me in an interview for internship.

Answer»

Correct option is (d) O (1)

EXPLANATION: In order to perform the concatenation on the rope DATA structure, one can create two nodes S1 and S2 and then performing the operation in constant time that is the time complexity is O (1).

8.

What is the time complexity for finding the node at x position where n is the length of the rope?(a) O (log n)(b) O (n!)(c) O (n^2)(d) O (1)I need to ask this question from Binary Trees in division Binary Trees of Data Structures & Algorithms IThis question was addressed to me in a job interview.

Answer» RIGHT option is (a) O (log N)

For explanation: In order to FIND the node at x position in a rope data structure where N is the length of the rope, we start a recursive SEARCH from the root node. So the time complexity for worst case is FOUND to be O (log N).
9.

Which type of data structure does rope represent?(a) Array(b) Linked List(c) Queue(d) Binary TreeAsked question is from Binary Trees in chapter Binary Trees of Data Structures & Algorithms IThis question was posed to me in final exam.

Answer»

Correct option is (d) Binary Tree

Easy explanation - Rope is a special binary tree in which the end NODES contain the string and its length. The array is a linear data structure. Linked LIST is a linear data structure having a node CONTAINING data INPUT and the ADDRESS of the next node. The queue is a data structure working on the principle of FIFO.

10.

Which of the following is also known as Rope data structure?(a) Cord(b) String(c) Array(d) Linked ListMy enquiry is from Binary Trees in chapter Binary Trees of Data Structures & Algorithms IThe question was posed to me during a job interview.

Answer»

Correct answer is (a) Cord

Easy explanation - Array is a LINEAR data STRUCTURE. Strings are a collection and sequence of codes, alphabets or characters. LINKED List is a linear data structure having a NODE containing data input and the ADDRESS of the next node. The cord is also known as the rope data structure.

11.

Which of the following is the self-adjusting binary search tree?(a) AVL Tree(b) Splay Tree(c) Top Tree(d) Ternary TreeMy question is taken from Binary Trees in portion Binary Trees of Data Structures & Algorithms II had been asked this question during an online exam.

Answer»

Correct option is (B) Splay Tree

Best explanation: Splay tree is a self – adjusting BINARY search tree. It performs basic operations on the tree LIKE insertion, deletion, LOOP up performing all these operations in O (log n) time.

12.

What is the time complexity for the update cost on auxiliary trees?(a) O (log (log n))(b) k-1 O (log n)(c) K^2 O (log n)(d) k+1 O (log (log n))This interesting question is from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms IThis question was posed to me by my school principal while I was bunking the class.

Answer»

The correct OPTION is (d) k+1 O (LOG (log n))

The explanation is: The UPDATE COST also is bounded by the upper bound. We perform one cut as well as one join operation for the AUXILIARY tree, so the total update cost for the auxiliary tree is found to be k+1 O (log (log n)).

13.

What is the time complexity for searching k+1 auxiliary trees?(a) k+2 O (log (log n))(b) k+1 O (log n)(c) K+2 O (log n)(d) k+1 O (log (log n))I'd like to ask this question from Binary Trees topic in division Binary Trees of Data Structures & Algorithms II had been asked this question in an interview for internship.

Answer»

The correct option is (d) k+1 O (log (log n))

The BEST I can explain: Since each search operation in the AUXILIARY tree takes O (log (log n)) time as auxiliary tree SIZE is bounded by the height of the REFERENCE tree that is log n. So for k+1 auxiliary trees, TOTAL search time is k+1 O (log (log n)).

14.

What is the upper bound for a tango tree if k is a number of interleaves?(a) k+2 O (log (log n))(b) k O (log n)(c) K^2 O (log n)(d) k+1 O (log (log n))My doubt is from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms IThis question was posed to me during a job interview.

Answer»

The CORRECT choice is (d) k+1 O (log (log n))

Best EXPLANATION: UPPER BOUND is found to analyze the work done by a tango TREE on a given set of sequences. In order to connect to the tango tree, the upper bound is found to be k+1 O (log (log n)).

15.

Which operation is used to break a preferred path into two sets of parts at a particular node?(a) Differentiate(b) Cut(c) Integrate(d) JoinMy doubt stems from Binary Trees in section Binary Trees of Data Structures & Algorithms IThe question was posed to me in an interview.

Answer»

Correct answer is (b) Cut

To explain: A preferred path is broken into TWO parts. One of them is known as TOP part while other is known as bottom part. To BREAK a preferred path into two SETS, cut operation is USED at a particular node.

16.

Is partitioning method used by Tango Tree.(a) True(b) FalseThe doubt is from Binary Trees topic in division Binary Trees of Data Structures & Algorithms II had been asked this question during an online interview.

Answer»

Correct option is (a) True

The best I can explain: PARTITIONING METHOD is used by tango tree which PARTITIONS a binary search tree into small sets of paths and then STORING them to auxiliary TREES. Hence tango tree is represented as a tree of trees.

17.

Which operation is used to combine two auxiliary trees?(a) Join(b) Combinatorial(c) Add(d) ConcatenationThis is a very interesting question from Binary Trees in portion Binary Trees of Data Structures & Algorithms IThe question was posed to me by my college director while I was bunking the class.

Answer»

The correct option is (a) JOIN

For EXPLANATION: If the TOP NODE of one of the reference tree amongst the two, is the is the child of the bottom node of the other reference tree, then the join OPERATION can be carried out to join the two auxiliary trees.

18.

Is tango tree represented as a tree of trees.(a) True(b) FalseMy doubt stems from Binary Trees in portion Binary Trees of Data Structures & Algorithms IThe question was asked in final exam.

Answer» RIGHT ANSWER is (a) True

Easiest explanation - Partitioning METHOD is used by tango tree which partitions a binary search tree into small sets of paths and then STORING them to auxiliary trees. HENCE tango tree is represented as a tree of trees.
19.

Which special balanced binary search tree is used to store the nodes of auxiliary tree?(a) Red – Black Tree(b) Red – Brown Tree(c) Red – Yellow Tree(d) Red – Tango TreeThis intriguing question comes from Binary Trees in portion Binary Trees of Data Structures & Algorithms IThe question was posed to me during an interview.

Answer»

Correct option is (a) Red – Black Tree

For explanation: The path starting from the root and FOLLOWING the path of PREFERRED child node till the END of LEAF node is known as preferred path. Nodes are stored in Red – Black tree for the representation of the preferred path.

20.

Which type of binary search tree is imitated for construction of tango tree?(a) Complete Binary Search Tree(b) Perfect Binary Search Tree(c) Balanced Binary Search Tree(d) Degenerate Binary Search TreeMy doubt is from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms II had been asked this question in unit test.

Answer»

Correct choice is (a) COMPLETE Binary Search Tree

For EXPLANATION: Tango tree is constructed by simulating a complete binary search tree. This tree is also known as Reference tree, that CONTAINS all the elements of the tree. Also, the reference tree is never showed in ACTUAL implementation.

21.

What is the time complexity of for achieving competitive ratio by tango tree?(a) O (log n)(b) O (n^2)(c) O (n!)(d) O (log (log n))My question is based upon Binary Trees topic in section Binary Trees of Data Structures & Algorithms II had been asked this question in an internship interview.

Answer»

The correct choice is (d) O (log (log n))

The explanation is: TANGO tree is an online binary SEARCH tree whose time COMPLEXITY is O (log (log n)) when compared to the time complexity of offline binary search tree model. Online algorithm processes input or data PROVIDED piece by piece.

22.

Which type of binary search tree or algorithm does tango tree use?(a) Online(b) Offline(c) Static(d) DynamicThe doubt is from Binary Trees in section Binary Trees of Data Structures & Algorithms II have been asked this question in homework.

Answer» CORRECT answer is (d) Dynamic

Explanation: Tango tree is an ONLINE binary search tree whose time complexity is O (log (log n)) when compared to the time complexity of OFFLINE binary search tree MODEL. Online algorithm processes input or data provided PIECE by piece.
23.

After which city is tango tree named?(a) Vatican City(b) Buenos Aires(c) New York(d) CaliforniaMy query is from Binary Trees in division Binary Trees of Data Structures & Algorithms II have been asked this question in quiz.

Answer»

The correct CHOICE is (b) Buenos Aires

For explanation: Tango is a popular COUPLE dance or partner dance that was ORIGINATED in the 1880S somewhere between Argentina and Uruguay. Buenos Aires is a capital city off Argentina. Hence they named after Buenos Aires.

24.

Which type of tree is tango tree?(a) Ternary Tree(b) AVL Tree(c) Binary Search Tree(d) K-ary TreeI'm obligated to ask this question of Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms IThis question was addressed to me in final exam.

Answer»

Right answer is (c) Binary Search Tree

Easiest explanation - TANGO tree is an EXAMPLE of binary search tree which was developed by four famous SCIENTISTS Erik Demaine, Mihai Patrascu, JOHN Lacono and Harmon in the year 2004.

25.

Who developed the concept of tango tree?(a) Erik Demaine(b) Mihai Patrascu(c) John Lacono(d) All of the mentionedOrigin of the question is Binary Trees in division Binary Trees of Data Structures & Algorithms IThis question was addressed to me by my college professor while I was bunking the class.

Answer»

Right answer is (d) All of the mentioned

The best explanation: Erik Demaine is a well-known PROFESSOR of COMPUTER Science at MIT. John Lacono is an American computer scientist specialized in data structure and ALGORITHM while Mihai Patrascu was a Romanian- American computer scientist. All of them TOGETHER developed the concept of Tango tree.

26.

What is inefficient with the below threaded binary tree picture?(a) it has dangling pointers(b) nothing inefficient(c) incorrect threaded tree(d) space is being used moreMy question comes from Threaded Binary Tree in portion Binary Trees of Data Structures & Algorithms IThis question was posed to me in an interview for internship.

Answer»

Right answer is (a) it has DANGLING pointers

Easy explanation - The NODES extreme LEFT and right are pointing to nothing which could be ALSO used EFFICIENTLY.

27.

What are double and single threaded trees?(a) when both left, right nodes are having null pointers and only right node is null pointer respectively(b) having 2 and 1 node(c) using single and double linked lists(d) using heaps and priority queuesOrigin of the question is Threaded Binary Tree in section Binary Trees of Data Structures & Algorithms IThis question was posed to me in a national level competition.

Answer»

Correct choice is (a) when both LEFT, RIGHT NODES are having null POINTERS and only right NODE is null pointer respectively

Explanation: They are properties of double and single threaded binary trees respectively.

28.

Which of the following tree traversals work if the null left pointer pointing to the predecessor and null right pointer pointing to the successor in a binary tree?(a) inorder, postorder, preorder traversals(b) inorder(c) postorder(d) preorderThe doubt is from Threaded Binary Tree in portion Binary Trees of Data Structures & Algorithms II got this question during an interview.

Answer»

Correct choice is (a) inorder, postorder, preorder traversals

To explain: In threaded binary trees, the null left pointer POINTS to the PREDECESSOR and the right null pointer point to the successor. In threaded binary trees, we can USE in-order, preorder and postorder traversals to visit EVERY node in the tree.

29.

What are null nodes filled with in a threaded binary tree?(a) inorder predecessor for left node and inorder successor for right node information(b) right node with inorder predecessor and left node with inorder successor information(c) they remain null(d) some other values randomlyMy doubt is from Threaded Binary Tree in chapter Binary Trees of Data Structures & Algorithms II got this question by my college director while I was bunking the class.

Answer» CORRECT choice is (a) inorder predecessor for LEFT NODE and inorder successor for right node information

The best I can explain: If preorder or POSTORDER is used then the respective predecessor and successor info is STORED.
30.

In general, the node content in a threaded binary tree is ________(a) leftchild_pointer, left_tag, data, right_tag, rightchild_pointer(b) leftchild_pointer, left_tag(c) leftchild_pointer, left_tag, right_tag, rightchild_pointer(d) leftchild_pointer, left_tag, dataQuestion is taken from Threaded Binary Tree in portion Binary Trees of Data Structures & Algorithms IThis question was addressed to me in homework.

Answer»

The correct answer is (a) leftchild_pointer, left_tag, data, right_tag, rightchild_pointer

Easiest explanation - It contains ADDITIONAL 2 pointers over normal binary TREE node structure.

31.

What are the disadvantages of normal binary tree traversals?(a) there are many pointers which are null and thus useless(b) there is no traversal which is efficient(c) complexity in implementing(d) improper traversalsMy enquiry is from Threaded Binary Tree in chapter Binary Trees of Data Structures & Algorithms IThe question was asked in an interview.

Answer»

Right CHOICE is (a) there are many pointers which are null and thus useless

The best I can explain: As there are MAJORITY of pointers with null value going WASTED we use threaded BINARY TREES.

32.

What is a threaded binary tree traversal?(a) a binary tree traversal using stacks(b) a binary tree traversal using queues(c) a binary tree traversal using stacks and queues(d) a binary tree traversal without using stacks and queuesOrigin of the question is Threaded Binary Tree topic in chapter Binary Trees of Data Structures & Algorithms IThe question was posed to me during an interview.

Answer» RIGHT ANSWER is (d) a binary tree traversal WITHOUT using STACKS and queues

For explanation: This type of tree traversal will not use STACK or queue.
33.

Who invented treaps?(a) Cecilia and Raimund(b) Arne Andersson(c) Donald Shell(d) Harris and RossMy query is from Binary Trees topic in division Binary Trees of Data Structures & Algorithms IThis question was addressed to me in a job interview.

Answer»

Correct answer is (a) Cecilia and Raimund

The BEST I can explain: Cecilia and Raimund invented Treaps. Arne ANDERSSON invented AA – Trees. Donald Shell invented shell sort and HARRIS and Ross formulated maximum flow PROBLEM.

34.

What is the priority of a null node?(a) 1(b) 0(c) random number(d) infinityMy doubt is from Binary Trees in division Binary Trees of Data Structures & Algorithms II got this question in an online quiz.

Answer»

The correct answer is (d) INFINITY

Easiest explanation - The PRIORITY of a null node is set to be infinity in a treap so that during deletion, priority of that PARTICULAR node is set to infinity, rotated and FREED.

35.

Which node has the lowest priority in a treap?(a) root node(b) leaf node(c) null node(d) centre nodeThe query is from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms II got this question during a job interview.

Answer» RIGHT choice is (a) ROOT node

The best explanation: A root node has the LOWEST priority in a treap SINCE the node’s priority is based on heap order.
36.

What is the average running time of a treap?(a) O(N)(b) O(N log N)(c) O(log N)(d) O(M log N)This intriguing question comes from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms IThis question was addressed to me in a national level competition.

Answer» RIGHT answer is (c) O(log N)

For EXPLANATION: The AVERAGE case and worst case analysis of a TREAP are MATHEMATICALLY found to be O(log N).
37.

Several other operations like union set difference and intersection can be done in treaps.(a) True(b) FalseMy enquiry is from Binary Trees in division Binary Trees of Data Structures & Algorithms II had been asked this question during an online exam.

Answer»

Right ANSWER is (a) True

The best explanation: Other than insertion, deletion and search OPERATIONS, several operations like union, intersection and SET difference can be DONE in treaps.

38.

What is the condition for priority of a node in a treap?(a) a node’s priority should be greater than its parent(b) a node’s priority should be at least as large as its parent(c) the priority is randomly assigned and can have any value(d) a node’s priority is always given in decreasing orderThis interesting question is from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms IThe question was asked at a job interview.

Answer»

Right choice is (B) a NODE’s priority should be at least as LARGE as its parent

Best EXPLANATION: A node’s priority should SATISFY heap order. That is, any node’s priority should be at least as large as its parent.

39.

A treap is a combination of a tree and a heap.(a) false(b) trueMy doubt is from Binary Trees in section Binary Trees of Data Structures & Algorithms IThe question was asked during an online exam.

Answer» RIGHT option is (b) true

Easy explanation - A treap is a COMBINATION of a TREE and a heap. The STRUCTURE of a treap is DETERMINED by the fact that it is heap-ordered.
40.

What is the reason behind the simplicity of a treap?(a) Each node has data and a pointer(b) Each node is colored accordingly(c) It is a binary search tree following heap principles(d) Each node has a fixed priority fieldI would like to ask this question from Binary Trees in division Binary Trees of Data Structures & Algorithms II have been asked this question during an interview.

Answer»

Right option is (d) Each NODE has a FIXED PRIORITY field

The explanation is: A treap is the SIMPLEST of all because we don’t have to worry about adjusting the priority of a node.

41.

Which is the simplest of all binary search trees?(a) AVL tree(b) Treap(c) Splay tree(d) Binary heapThe origin of the question is Binary Trees topic in division Binary Trees of Data Structures & Algorithms IThe question was asked in my homework.

Answer»

The correct OPTION is (b) TREAP

Easiest explanation - A treap is the SIMPLEST of all binary SEARCH trees. Each node is given a numeric priority and implementation is non RECURSIVE.

42.

What is the space complexity of a treap algorithm?(a) O(N)(b) O(log N)(c) O(log N)(d) O(N^2)The above asked question is from Binary Trees in section Binary Trees of Data Structures & Algorithms IThe question was asked during an interview.

Answer»

The correct answer is (a) O(N)

The EXPLANATION is: The AVERAGE CASE and worst case space COMPLEXITY of a treap is MATHEMATICALLY found to be O(N).

43.

What is the disadvantage of using splay trees?(a) height of a splay tree can be linear when accessing elements in non decreasing order.(b) splay operations are difficult(c) no significant disadvantage(d) splay tree performs unnecessary splay when a node is only being readThe doubt is from Splay Tree topic in section Binary Trees of Data Structures & Algorithms II got this question during an interview for a job.

Answer»

The CORRECT option is (a) height of a SPLAY tree can be LINEAR when accessing elements in non decreasing order.

The best I can explain: This will be the case after accessing all n elements in non-decreasing order. SINCE the height of a tree corresponds to the worst-case access time, this means that the actual cost of an operation can be HIGH. However the amortized access cost of this worst case is logarithmic O(log n).

44.

After the insertion operation, is the resultant tree a splay tee?(a) true(b) falseMy question is taken from Splay Tree topic in portion Binary Trees of Data Structures & Algorithms IThis question was addressed to me in an online interview.

Answer»

Right option is (a) true

Easiest EXPLANATION - There is a ZIG-zag and right operation(zig) which gives the right hand side TREE. REFER splay operations for INSERTION in splay tree.

45.

When we have red-black trees and AVL trees that can perform most of operations in logarithmic times, then what is the need for splay trees?(a) no there is no special usage(b) In real time it is estimated that 80% access is only to 20% data, hence most used ones must be easily available(c) redblack and avl are not upto mark(d) they are just another type of self balancing binary search treesMy question comes from Splay Tree in portion Binary Trees of Data Structures & Algorithms II had been asked this question in exam.

Answer»

Right option is (b) In REAL TIME it is estimated that 80% access is only to 20% data, hence most USED ones must be easily available

Easy EXPLANATION - May be the stats showing 80-20% may be not ACCURATE, but in real time that is the widely spread scenario seen. If you are into this type of situation, you must choose implementing splay trees.

46.

Which of the following options is an application of splay trees?(a) cache Implementation(b) networks(c) send values(d) receive valuesI'm obligated to ask this question of Splay Tree topic in division Binary Trees of Data Structures & Algorithms II have been asked this question in an internship interview.

Answer»

Right answer is (a) cache Implementation

The EXPLANATION is: SPLAY trees can be used for FASTER ACCESS to recently accessed items and hence used for cache IMPLEMENTATIONS.

47.

What is a splay operation?(a) moving parent node to down of child(b) moving a node to root(c) moving root to leaf(d) removing leaf nodeMy enquiry is from Splay Tree in portion Binary Trees of Data Structures & Algorithms IThis question was addressed to me by my school principal while I was bunking the class.

Answer»

Right CHOICE is (b) MOVING a node to root

For EXPLANATION: Splay trees mainly work using splay OPERATIONS. wheneve we insert, delete and search for a node we splay the respective nodes to root. we have zig-zag and zig-zig operations.

48.

Is it true that splay trees have O(logn) amortized complexity ?(a) true(b) falseEnquiry is from Splay Tree topic in section Binary Trees of Data Structures & Algorithms II had been asked this question by my school teacher while I was bunking the class.

Answer»

The correct choice is (a) true

Best EXPLANATION: We GO with amortized time complexity when we feel that not all OPERATIONS are worst and some can be efficiently done. in splay TREES not all splay operations will lead to O(logn) worst case complexity.

49.

Why to prefer splay trees?(a) easier to program(b) space efficiency(c) easier to program and faster access to recently accessed items(d) quick searchingMy enquiry is from Splay Tree topic in portion Binary Trees of Data Structures & Algorithms IThis question was addressed to me in a national level competition.

Answer»

Right choice is (c) easier to program and faster access to recently accessed items

Best explanation: Whenever you INSERT an ELEMENT or remove or READ an element that will be pushed or STORED at the top which facilitates easier access or recently used stuff.

50.

Which of the following property of splay tree is correct?(a) it holds probability usage of the respective sub trees(b) any sequence of j operations starting from an empty tree with h nodes atmost, takes O(jlogh) time complexity(c) sequence of operations with h nodes can take O(logh) time complexity(d) splay trees are unstable treesMy doubt is from Splay Tree in division Binary Trees of Data Structures & Algorithms II got this question in examination.

Answer»

The correct choice is (b) any sequence of j operations STARTING from an empty tree with h nodes atmost, takes O(jlogh) time complexity

For EXPLANATION: This is a PROPERTY of splay tree that ensures faster access. we PUSH the most RECENTLY used nodes to top which leads to faster access to recently used values.