Question Bank On Linked List, Queue and Tree1
Question Bank On Linked List, Queue and Tree1
void count()
{
struct node *ptr;
int c=0;
ptr=start;
while(ptr!= NULL)
{
ptr=ptr->next;
C++;
}
printf("no of nodes in list are %d\n", c);
}
8) Write an algorithm to delete a node at the beginning from a singly linked list.
9) Write an algorithm to delete an intermediate node in a singly linked list.
10) Explain operations on singly linked list.
11) Define term pointer and null pointer.
12) Describe advantages of circular link list over linear link list with example.
13) Describe circular linked list with suitable diagram.
14) Define linked list with suitable diagram.
15) Explain the concept of information, next, null pointer and empty list with respect to linked list.
Unit No. 5
1) Draw the diagram of circular queue with front and rear pointers.
2) State any four applications of queue.
3) Explain Queue overflow and underflow conditions with examples.
4) List any four types of queue.
5) Differentiate between Stack and Queue (any four points).
6) With a neat sketch explain working of priority queue.
7) Write a 'C' program for insert and delete operation to be performed on queue.
8) Draw the diagram of Linear Queue to represent front and rear pointers.
9) Show the effect of INSERT and DELETE operation onto the linear queue of size 10. The linear queue
sequential contains 10, 20, 30, 40 and 50 where 10 is at front queue.
10) List any four applications of queue.
11) With a neat sketch explain working of priority queue.
Unit No. 6
Degree of tree :
Degree of node B:
Level of node H:
Indegree of node C:
Outdegree of node B:
11) Draw an expression tree for the following expression: (a+3b - 7c)³ * (6d-8c).
12) Define the term tree traversal. Construct the Binary Search Tree (BST) of following: 85, 90, 45, 60, 25, 35, 10,
20, 75, 95 and traverse the above BST in inorder, preorder and postorder.
13) Define the terms w.r.t., tree, In-degree and Out-degree.
14) Draw a binary search tree for the given numbers: 50, 33, 44, 22, 77, 35, 60, 40.