Recent questions tagged data-structures

12 12 votes
5 5 answers
8.0k
8.0k views
The number of ways we can insert elements { 1, 2, 3, .... 7 } to make an AVL tree, so that it does not have any rotation are _______ ?
5 5 votes
1 answers 1 answer
12.7k
12.7k views
What's the difference between Binary tree height, level and depth? Sometimes it's confusing!Does there definition change according to question also, if mentioned?
7 7 votes
7 answers 7 answers
109k
109k views
Level of a node is distance from root to that node. For example, level of root is 1 and levels of left and right children of root is 2. The maximum number of nodes on lev...
2 2 votes
1 answers 1 answer
9.6k
9.6k views
What is the worst case possible height of an AVL tree??a. 2logn (Assume base of log is 2) b. 1.44log n (Assume base of log is 2)c. Depends upon implementationd. Thet...
0 0 votes
2 2 answers
1.8k
1.8k views
I am stuck after JAN. It is not getting balanced even after 2 rotations. Can somebody help?
0 0 votes
1 1 answer
1.4k
1.4k views
0 0 votes
0 0 answers
681
681 views
A weight balanced tree is a binary tree in which for each node, the no. of nodes in the left subtree is atleast half and at most twice the no. of nodes in the right sub t...
0 0 votes
0 0 answers
525
525 views
If tthere are two lower triangular matrix A and B.A and transpose B are stored in C. by storing only non zero elements.what should be the dimension of C.And A[i][j]= C[i]...
1 1 vote
1 1 answer
7.7k
7.7k views
Consider a hashing function that resolves collision by quadratic probing .Assume the address space is indexed from $1$ to $6$. Which of the following locations will never...
0 0 votes
1 answers 1 answer
1.1k
1.1k views
describe in details
0 0 votes
1 1 answer
1.3k
1.3k views
Consider the following "Max Heapify" algorithm. Array has atleast n and 1<=i<=n. After applying the Max-heapify rooted at A[i], the result will be subtree of A[1,....n] r...
0 0 votes
2 2 answers
5.1k
5.1k views
My question is : in the row [8][-8] to [8][5] will be 5-(-8)+1 = 14 elements , right ? so , it should be 1060 then considering 4 Byte is one element.I know , this is pret...
1 1 vote
1 answers 1 answer
1.4k
1.4k views
When searching for the key value 50 in a binary search tree, node containing the key values 10, 30, 40, 70, 90, 120, 150, 175 are traversed, in any order. The number of d...
1 1 vote
2 2 answers
1.1k
1.1k views
Delete the duplicate nodeDelete the alternate duplicate nodeDelete the adjacent nodeNone of these
0 0 votes
1 1 answer
734
734 views
Consider the below code which run on any tree.In-order traversalPost-order traversalPre-order traversalNone of these
0 0 votes
0 0 answers
563
563 views
0 0 votes
2 answers 2 answers
1.5k
1.5k views
Preorder(root){ Printf("root.data"); Preorder(root.leftsidetree); Preorder(root.rightside);}
0 0 votes
2 2 answers
1.3k
1.3k views
0 0 votes
1 answers 1 answer
939
939 views
Is it possible to delete intermediate node/number in Heap? Not a root or last.
2 2 votes
2 2 answers
1.2k
1.2k views
Consider the process of inserting an element into a max heap, where the max heap is represented by an array.Suppose we perform a binary search on the path from the new le...
0 0 votes
2 2 answers
7.3k
7.3k views
The following post-fix expression with single digit operands is evaluated using stack, $16\;2\;4\;\wedge \; / \;4\;3\;*\;+\;6\;2\;*\;-$Note that $\wed...
0 0 votes
2 2 answers
988
988 views
When searching for the key value 50 in a binary search tree, node containing the key values 10, 30, 40, 70, 90, 120, 150, 175 are traversed, in any order. The number of d...
0 0 votes
3 answers 3 answers
5.5k
5.5k views
Given preorder and postorder traversal of binary search tree.Preorder: 50, 27, 16, 4, 12, 34, 29, 44, 88, 65, 52, 77, 93, 92Postorder: 12, 4, 16, 29, 44, 34, 27, 52, 77, ...
1 1 vote
2 2 answers
3.0k
3.0k views
Which of the following statement is/are correct?1. If we use only Front pointer in queue, then insertion takes O(n) time while deletion in O(1) time.2. If we use only Rea...
16 16 votes
3 answers 3 answers
18.8k
18.8k views
A is an array $[2.....6, 2.....8, 2.......10]$ of elements. The starting location is $500$. The location of an element $A(5, 5, 5)$ using column major order is __________...
1 1 vote
0 0 answers
742
742 views
Whats is subarray ? Can you explain with example?!
1 1 vote
1 1 answer
1.2k
1.2k views
Given answer: APlease explain.
11 11 votes
2 answers 2 answers
2.8k
2.8k views
Let $T$ be a rooted binary tree whose vertices are labelled with symbols $a, b, c, d, e, f, g, h, i, j, k$. Suppose the in-order (visit left subtree, visit root, visit ri...