0% found this document useful (0 votes)
44 views2 pages

Question Bank On Linked List, Queue and Tree1

Uploaded by

hiwraleanand563
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views2 pages

Question Bank On Linked List, Queue and Tree1

Uploaded by

hiwraleanand563
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Unit No.

1) Write an algorithm to traverse a linked list.


2) Write an algorithm to insert a new node at the beginning of a singly linked list. Give example.
3) Write an algorithm to search an element in linked list.
4) Create a singly linked list using fields 70, 50,30,40,90. Search a node 40 from the singly linked list and show
procedure step-by step with the help of diagram from start to end.
5) Explain node structure for single linked list. Also write advantages of singly list over array.
6) Compare linear list with circular list.
7) Write the 'C' function for: (i) searching a node in single linked list. (ii) counting number of nodes in single
linked list.

Counting number of nodes in single linked list:

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

1) Define General tree and Binary tree.


2) 2. Construct a binary search tree for following elements: 22, 27, 14, 31, 40, 43, 44, 10, 20, 35. Show
each step of construction of BST.
3) Draw tree for the expression and find pre-order and post-order traversal, (2b+5c)² (4d-6e)³.
4) Define the terms Sibling and Depth of tree.
5) Write algorithm for preorder traversal of binary tree.
6) Explain Binary Search Tree (BST) with example.
7) Draw tree for given expression: (a-2b+5c)² * (4d -6e)5
8) State the terms, Leaf node and Degree of a tree.
9) Construct the Binary Search Tree using following elements: (35, 15, 40, 7, 10, 100, 28, 82, 53, 25, 30). Show
diagrammatically each Step of construction of BST.
10) From the given tree, complete the answers:

Degree of tree :

Degree of node B:

Level of node H:

Indegree of node C:

Outdegree of node B:

Height of the tree:

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy