Algochallenges
86 subscribers
1 link
Daily algorithm questions with explanations. Prepare for your next coding interview!
Download Telegram
3. What must be the ideal size of array if the height of tree is ‘l’?
Anonymous Quiz
69%
2^l-1
16%
I-1
3%
I
11%
2I
How often do you want algo questions?
Anonymous Poll
16%
Once every other day
28%
Once per day
55%
Twice per day
In quicksort, which of the following methods is the most effective for picking the pivot element?
Anonymous Quiz
11%
first element
6%
last element
66%
median-of-three partitioning
17%
random element
The average depth of a binary tree is given as?
Anonymous Quiz
14%
O(N)
14%
O(√N)
16%
O(N2)
56%
O(log N)
If binary trees are represented in arrays, what formula can be used to locate a left child, if the node has an index i?
Anonymous Quiz
56%
2i+1
23%
2i+2
19%
2i
2%
4i
Using what formula can a parent node be located in an array?
Anonymous Quiz
47%
(i+1)/2
22%
(i-1)/2
20%
i/2
12%
2i/2
What are the worst case and average case complexities of a binary search tree?
Anonymous Quiz
24%
O(n), O(n)
37%
O(logn), O(logn)
19%
O(logn), O(n)
20%
O(n), O(logn)
What will be the height of a balanced full binary tree with 8 leaves?
Anonymous Quiz
20%
8
5%
5
7%
6
68%
4
Know a friend preparing for a tech-interview? Help them out and invite them to Algochallenges! 🙌 https://t.me/algochallenges
A binary tree is balanced if the difference between left and right subtree of every node is not more than ____
Anonymous Quiz
47%
1
8%
3
26%
2
19%
0
Balanced binary tree with n items allows the lookup of an item in ____ worst-case time.
Anonymous Quiz
41%
O(logn)
33%
O(nlog2)
24%
O(n)
3%
O(1)
Two balanced binary trees are given with m and n elements respectively. They can be merged into a balanced binary search tree in x time.
Anonymous Quiz
44%
O(m+n)
23%
O(mn)
6%
O(m)
27%
O(mlogn)
AVL trees are more balanced than Red-black trees.
Anonymous Quiz
75%
True
25%
False
In a max-heap, element with the greatest key is always in the which node?
Anonymous Quiz
18%
Leaf node
28%
First node of left sub tree
50%
Root node
5%
First node of right sub tree
What is the complexity of adding an element to a heap?
Anonymous Quiz
43%
O(logn)
27%
O(h)
18%
O(logn) & O(h)
11%
O(n)
The worst case complexity of deleting any arbitrary node value element from heap is __________
Anonymous Quiz
38%
O(logn)
15%
O(n)
26%
O(nlogn)
21%
O(n^2)