0% found this document useful (0 votes)
28 views8 pages

Question Bank (IT-1) Data Structures

Uploaded by

23cs047
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)
28 views8 pages

Question Bank (IT-1) Data Structures

Uploaded by

23cs047
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/ 8

Question Bank

(for Internals – I)

Unit: 1 Introduction to data structures and Linked List

Part - A
1. Define linked list. Write the representation of linked lists in memory
2. How the nodes are represented using C
3. Explain linked list operation with examples
4. What is doubly linked list. Write the declaration of doubly linked list in C
5. With the C program explain how the elements are inserted and deleted from a
doubly linked list
6. Write a note on a header linked list
7. Briefly explain linked stack and queue
8. Apply linked list to represent two polynomials and write a function to add the
polynomials using linked list
9. Explain a linked list representation for sparse matrices
10. List out any two applications of linked list and any two advantages of doubly
linked list over singly linked list
11. Write short note on circular lists. Write a function to insert a node at front and rear
end in a circular linked list. Write down sequence of steps to be followed.
12. Write the following functions for singly linked list: i) Reverse the list
ii)Concatenate two lists
13. What is a linked list? Explain the different types of linked list with diagram. Write
C program to implement the insert and delete operation on a queue using linked
list.

Data Structures Concepts - Group - 7


Part – B&C
1. Define a Data Structure. Explain the concept of abstract data types (ADT) with
examples. How do ADTs help in organizing data? (16 marks)
2. a) Describe the difference between primitive and non-primitive data structures.
Provide examples of both. (8 marks)
b) Explain the importance of abstract data types (ADT) in programming and data
structures. (8 marks)
3. What is a Linear List? Explain the operations (insertion, deletion, and searching) that
can be performed on a linear list. Write a C program to implement these operations on
a singly linked list. (16 marks)
4. a) Explain the concept of a singly linked list. How is it different from an array? (8
marks)
b) Write a C program to implement insertion and deletion operations on a singly
linked list. (8 marks)
5. What is a circular linked list? Explain how it differs from a singly linked list. Write a
C program to implement insertion and deletion operations on a circular linked list. (16
marks)
6. a) Explain the structure of a doubly linked list. Discuss the advantages of a doubly
linked list over a singly linked list. (8 marks)
b) Write a C program to implement insertion and deletion operations on a doubly
linked list. (8 marks)
7. Compare and contrast singly linked lists, circular linked lists, and doubly linked
lists. Discuss the scenarios where each of these would be more useful. (16 marks)
8. a) Explain the searching operation on a singly linked list. Discuss the time
complexity for searching an element in a linked list. (8 marks)
b) Write a C program to search for an element in a singly linked list. (8 marks)
9. What is a circular linked list? Discuss its applications and how it can be
implemented using pointers. Write a C program to search and delete a node in a
circular linked list. (16 marks)
10.a) Describe the applications of linked lists in real-world scenarios. Why are linked
lists preferred in some situations over arrays? (8 marks)
b) Explain the role of linked lists in dynamic memory allocation. (8 marks)
11.What are the advantages and disadvantages of using linked lists? Compare linked
lists with arrays and discuss the trade-offs in terms of memory and performance. (16
marks)
12.a) Explain the process of inserting a node at the beginning and end of a singly
linked list. (8 marks)

Data Structures Concepts - Group - 7


b) Write a C program to implement node insertion at the beginning and end of a
singly linked list. (8 marks)
13.Explain how a doubly linked list allows traversal in both directions. Write a C
program to perform forward and backward traversal of a doubly linked list. (16 marks)
14.a) Describe the key differences between circular and doubly linked lists with
examples. (8 marks)
b) Write a C program to implement a circular doubly linked list with insertion and
deletion operations. (8 marks)
15.Discuss the role of linked lists in implementing stack and queue data structures.
Provide examples of how these structures are implemented using singly and doubly
linked lists. (16 marks)

Data Structures Concepts - Group - 7


Unit: 2 Stacks and Queues

Part - A
Stacks:
1. Define a stack. Explain the operations performed on a stack with examples.
2. How is a stack represented using an array? Write a C program to implement stack
operations using arrays.
3. Describe how a stack is implemented using a linked list. Write a C program to perform
push and pop operations using a linked list.
4. Explain infix to postfix conversion using stack operations. Write a C program to
implement infix to postfix conversion.
5. Write a C program to evaluate a postfix expression using a stack.
6. Explain the use of stacks in implementing recursion. Write a C program to
demonstrate recursion using a stack.
7. What is stack overflow and stack underflow? Explain the conditions with suitable
examples.
8. Explain how a stack is used for balancing parentheses in an expression. Write a C
program to check for balanced parentheses using a stack.
Queues:
9. What is a queue? Describe the operations performed on a queue with an example.
10.Write a C program to implement a queue using an array.
11.Write a C program to implement a queue using a linked list.
12.What is a circular queue? Write a C program to implement a circular queue using an
array.
13.Explain the difference between a circular queue and a normal queue. Write down the
sequence of steps for enqueue and dequeue operations in a circular queue.
14.What is a priority queue? Explain its applications and write a C program to implement
a priority queue.
15.Explain a dequeue (double-ended queue). Write a C program to demonstrate insertion
and deletion operations in a dequeue.

Data Structures Concepts - Group - 7


Part – B&C
1. Explain the stack ADT. Discuss its key operations (push, pop, peek) with examples
and write a C program to implement a stack using an array. (16 marks)
2. a) Describe the array and linked list representations of stacks. Compare both
approaches with their advantages and disadvantages. (8 marks)
b) Write a C program to implement stack operations using a linked list. (8 marks)
3. a) Explain the process of converting an infix expression to a postfix expression
using a stack. Provide a step-by-step example. (8 marks)
b) Write a C program to implement infix to postfix conversion. (8 marks)
4. What is a circular queue? Explain the advantages of circular queues over linear
queues. Write a C program to implement a circular queue using an array. (16 marks)
5. a) Describe the stack's role in implementing recursion. How does a stack support
recursive function calls? (8 marks)
b) Write a C program to simulate recursive function calls using a stack. (8 marks)
6. Explain the queue ADT. Discuss the operations performed on a queue with examples
and write a C program to implement a queue using a linked list. (16 marks)
7. a) Describe how a priority queue works. Discuss its applications and
implementation. (8 marks)
b) Write a C program to implement a priority queue using a heap. (8 marks)
8. What is the difference between a stack and a queue? Compare their operations,
applications, and real-world use cases. Provide examples to illustrate your points. (16
marks)
9. a) Explain postfix expression evaluation using a stack. Provide an example with
steps to evaluate the expression. (8 marks)
b) Write a C program to evaluate a postfix expression using a stack. (8 marks)
10.What is a dequeue (double-ended queue)? Explain the operations supported by a
dequeue and write a C program to implement a dequeue using an array. (16 marks)
11.a) Discuss the concept of circular queues and how they solve the problem of unused
space in linear queues. (8 marks)
b) Write a C program to perform enqueue and dequeue operations in a circular
queue. (8 marks)
12.Explain the role of stacks in balancing parentheses in an expression. Write a C
program to check for balanced parentheses using a stack. (16 marks)
13.a) Describe the concept of a stack overflow and underflow in stack operations. (8
marks)
b) Write a C program to implement stack overflow and underflow detection in a
stack using arrays. (8 marks)

Data Structures Concepts - Group - 7


14.Compare and contrast linear queues and circular queues. Discuss their
advantages, disadvantages, and applications. (16 marks)
15.a) Explain the operations supported by a circular queue. Discuss its
implementation using both arrays and linked lists. (8 marks)
b) Write a C program to implement a circular queue using a linked list. (8 marks)

Data Structures Concepts - Group - 7


Unit: 3 Trees

Part - A

Tree ADT and Traversals

1. Define a Tree ADT (Abstract Data Type). Explain the key properties and operations
associated with a tree.
2. What is a general tree? Describe how a tree is different from other data structures like
arrays or linked lists.
3. Explain the different types of tree traversals: Preorder, Inorder, and Postorder with
examples.
4. Write a C program to perform preorder, inorder, and postorder traversals of a binary
tree.
5. What is a level-order traversal of a tree? Write a C program to implement level-order
traversal using a queue.
6. Explain the Left Child-Right Sibling representation of a general tree. How is it
different from the binary tree representation?
7. Write a C program to convert a general tree into its left child-right sibling
representation.

Binary Tree ADT

8. Define a binary tree. What are the different types of binary trees? Explain each with
diagrams.
9. What is a full binary tree, complete binary tree, and perfect binary tree? Provide
examples and differentiate between them.
10.Write a C program to create a binary tree and perform insertion and deletion
operations on it.
11.Explain the concept of a binary search tree (BST). How is it different from a normal
binary tree?
12.Write a C program to implement a binary search tree (BST) and perform search,
insert, and delete operations.

Expression Trees

13.What is an expression tree? Explain how an expression tree is constructed for a given
infix or postfix expression.
14.Write a C program to construct an expression tree from a postfix expression and
perform inorder, preorder, and postorder traversals.
15.Explain how expression trees are used to evaluate arithmetic expressions. Write a C
program to evaluate an arithmetic expression using an expression tree.

Data Structures Concepts - Group - 7


Part – B&C

1. Define a Binary Tree ADT. Explain the properties of binary trees and their various
types, such as full binary trees, complete binary trees, and perfect binary trees. (16
marks)
2. a) Describe the Left Child-Right Sibling representation of a general tree. Explain
how it works and how it differs from the binary tree representation. (8 marks)
b) Write a C program to convert a general tree into its Left Child-Right Sibling
representation. (8 marks)
3. a) Explain the different types of tree traversals: Preorder, Inorder, Postorder,
and Level-order. Illustrate with examples. (8 marks)
b) Write a C program to implement Inorder and Postorder traversals of a binary
tree. (8 marks)
4. What is an Expression Tree? Explain how an expression tree is constructed for a
given postfix expression. Write a C program to evaluate an arithmetic expression
using an expression tree. (16 marks)
5. a) What is a Binary Search Tree (BST)? Explain how insertion and deletion
operations work in a BST. (8 marks)
b) Write a C program to implement a Binary Search Tree and perform insert
and delete operations. (8 marks)
6. Explain how trees can be used to represent hierarchical data. Give examples of
hierarchical data that can be represented using trees, and discuss the advantages of
using trees for such data. (16 marks)
7. a) Describe the Preorder and Postorder traversals of a binary tree with
appropriate examples. (8 marks)
b) Write a C program to perform Preorder traversal of a binary tree. (8 marks)
8. Compare and contrast Binary Trees with General Trees. Discuss their structure,
representation, and applications in data structures. (16 marks)
9. a) Explain the steps to convert an infix expression to a postfix expression using a
stack, and show how an expression tree can be built from the postfix expression. (8
marks)
b) Write a C program to build an expression tree from a postfix expression. (8
marks)
10. What are the key differences between Binary Trees and Binary Search Trees
(BSTs)? Write a C program to construct a BST and perform search operations on it.
(16 marks)

Data Structures Concepts - Group - 7

You might also like