Questions
How many null branches are there in a binary tree with 20 nodes?
- 5
- 21
- 18
- 22
The total number of binary trees possible with three unlabelled nodes is
- 5
- 6
- 7
- 8
Which one of the following sorting algorithms is using divide and conquer method?
- Bubble sort
- Selection sort
- Quick sort
- All of the above
For height H and root at level 0, how many number of nodes will be there in a binary tree?
- 2H+1 - 1
- 2H-1
- 2H+1 + 1
- 2H+1
For static memory location which of the following data structures is used?
- Stack
- Link list
- Tree
- Graph
Insert the following elements as binary search tree, 10, 11, 12, 13, 14, 15, 16, 17 and build AVL tree.
- 15
- 14
- 13
- 16
Which of the following data structures allows deletion of element from both the ends and insertion at only one end?
- Stack
- Priority queue
- Input restricted queue
- Output restricted queue
In-order traversal of a tree will yield a sorted list of elements of tree in
- binary trees
- binary search trees
- heaps
- None of the above
For height H and root at level 1, how many number of nodes will be there in a binary tree?
- 2H - 1
- 2H+1
- 2H+1 - 1
- None of the above
Which of the following data structures is used to perform recursion?
- Queue
- Stack
- Tree
- Linked list
Identify the correct sequence for stack, if the input sequence is 1, 2, 3, 4 and 5.
- 4, 3, 5, 1 and 2
- 4, 3, 5, 2 and 1
- 5, 4, 1, 2 and 3
- 5, 4, 3, 1 and 2
Which of the following data structures is used for locating memory at run time?
- Stack
- Queue
- Heap
- Link list
Calculate the number of distinct trees possible for 5 unlabelled NODE.
- 34
- 39
- 42
- 45
Which of the following is not self referential structure?
- Link list
- Graph
- Tree
- Stack
A link list contains following items:
The first item in link list is A, second is B, third is C, fourth is D and fifth is E. Here, A is pointing to B, B is pointing to C, C is pointing to D and D is pointing to E and E is the last item. Its link part contains NULL. What will be the output after the following sequence of steps? (First is the pointer pointing to first element)
- struct NODE*P;
- P=First->next->next;
- First->next->next=P->next;
- P->next->next=P;
- printf(%d,First->next->next->next->info);
- C
- A
- D
- E
Calculate the minimum number of nodes in AVL tree where height (H) is 8 and root at level 1.
- 56
- 54
- 58
- 64
If A [2] [2] [2] contains element 1 2 3 4 5 6 7 8. Then A [0] [0] [1] contains which element?
- 1
- 2
- 4
- 7
From which end of queue, elements are deleted?
- Front
- Rear
- Top
- None of the above
In stack, insertion of element takes place from which end?
- Front
- Rear
- Top
- None of the above
The In-order traversal of a tree is given as B C A E D F and pre-order traversal of tree is given as A B C D E F. What will be the post order traversal order?
- C B F E D A
- C B E F A D
- B C F E D A
- C B E F D A
In queue, from which end elements are inserted?
- Front
- Rear
- Top
- None of the above
If a binary search tree contains numbers and tree is traversed in order then in which order, numbers will be printed?
- Ascending order
- Random order
- Descending order
- None of the above
If a binary tree contains either two or zero children, then it is called as
- strictly binary tree
- binary tree
- AVL tree
- none of the above
Fill in the blank. Where 'i' is the stack no. and 'x' is the item to be inserted.
void Push( int i, int x ) {
if(-------) printf(Stackoverflow); elseS[++Top]=x;
}
- Top[i]=Top[i+1]
- Top[i]=Bottom[i+1]
- Top[i]=Bottom[i]
- Top[i]=Bottom[i-1]
Fill in the blank in the following code, where DOM is counting the number of nodes in link list.
int DOM() {
struct NODE *M= First;
int count=0;
while( _____ ) {
++count;
P=P->next; }
return count;
}
- P
- !P
- P->next
- !P->next