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 is the speciality about the inorder traversal of a binary search tree?
Anonymous Quiz
12%
It traverses in a nonincreasing order
60%
It traverses in an increasing order
2%
It traverses in a random fashion
26%
It traverses based on priority of the node
What are the worst case and average case complexities of a binary search tree?
Anonymous Quiz
21%
O(n), O(n)
39%
O(logn), O(logn)
19%
O(logn), O(n)
21%
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
The balance factor of a node in a binary tree is defined as _____
Anonymous Quiz
31%
addition of heights of left and right subtrees
28%
height of right subtree minus height of left subtree
28%
height of left subtree minus height of right subtree
14%
height of right subtree minus one
Know a friend preparing for a tech-interview? Help them out and invite them to Algochallenges! 🙌 https://t.me/algochallenges
Telegram
Algochallenges
Daily algorithm questions with explanations. Prepare for your next coding interview!
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
42%
O(logn)
32%
O(nlog2)
24%
O(n)
2%
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)
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)
A heap can be used as ________________
Anonymous Quiz
54%
Priority queue
37%
Stack
7%
A decreasing order array
2%
A normal array
An array consists of n elements. We want to create a heap using the elements. The time complexity of building a heap will be in order of
Anonymous Quiz
15%
O(n*n*logn)
58%
O(n*logn)
15%
O(n*n)
12%
O(n *logn *logn)
If several elements are competing for the same bucket in the hash table, what is it called?
Anonymous Quiz
8%
Diffusion
8%
Replication
80%
Collision
5%
Duplication
Which of the following is not a technique to avoid a collision?
Anonymous Quiz
34%
Make the hash function appear random
34%
Use the chaining method
16%
Use uniform hashing
16%
Increasing hash table size
What is the load factor?
Anonymous Quiz
37%
Average array size
12%
Average key size
15%
Average chain length
37%
Average hash table length
What is simple uniform hashing?
Anonymous Quiz
50%
Every element has equal probability of hashing into any of the slots
14%
A weighted probabilistic method is used to hash elements into the slots
21%
Elements has Random probability of hashing into array slots
14%
Elements are hashed based on priority