Important Questions (CM-304)
Important Questions (CM-304)
UNIT-1
SHORT ANSWER QUESTIONS:-
1. Define the term ‘data structure’.
2. Given the list 3, 6, 7, 8, 34 and 56. How many comparisons are required
to search for the element 7?
3. Explain the terms non-linear data structures and linear data structures
with examples
4. Define the terms ‘time complexity’ and ‘space complexity’.
5. Illustrate linear searching with an example.
6. Apply selection sort technique to sort the elements 3, 2, 6 and 8.
7. What is Abstract Data Structure (ADT). List any two abstract data types.
8. What is the principle of selection sort.
9. Write the need for sorting.
10.Write about linear search method.
11.Define the terms linear data structure and non-linear data structure.
12.Define sorting. List any two sorting techniques along with their time.
13.Write the method of bubble sorting.
14. What is the principle of quick sort.
15.What is searching. list the types of searching.
16.Write the algorithm for linear search.
17. Write the algorithm for binary search.
18.Illustrate the merging process with an example
19.Write the method of selection sort.
20.Write the method of merge sort.
LONG ANSWER QUESTIONS:-
1. Apply the quicksort technique on (34, 15, 67, 89 and 24) elements and
show the output of each iteration.
2. Apply the concept of recursion to write a C program for non-sorted
sequence using binary search.
3. Use the concept of an array to write a program for binary search for non-
sorted sequence.
4. Apply the concept of insertion sort on (3, 5, 1, 7, 8, 9, 12) and print the
odd iteration sequences.
5. Write the algorithm and explain the method of insertion sort with an
example.
6. Explain binary search method with an example and write the program for
it.
7. Write a C function to implement quick sort.
8. Write an algorithm to sort the given elements in ascending order using
bubble sort.
9. Classify the various data structure.
10.Explain selection sort method with an example and find it’s complexity.
11.Explain bubble sort method with an example and find it’s complexity.
12.Explain merge sort method with an example and find it’s complexity.
13.Explain linear search method with an example and find it’s complexity.
14.Explain binary search method with an example and find it’s complexity.
15.Write a c program for merge sort.
UNIT-2
SHORT ANSWER QUESTIONS:-
1. Define the term ‘Linked list’.
2. Demonstrate the concept of creation of a sample node using malloc().
3. Give the structure of a node in doubly linked list.
4. List any three advantages of linked lists over arrays.
5. Write the purpose of dummy header.
6. List the differences between array and linked list.
7. Draw the node structure of a doubly linked list. Write the equivalent C
structure to represent the node of a doubly linked list.
8. List of various linked lists.
9. What are the various operations possible on a linked list.
10.Write how a singly linked list is differ from circularly singly linked list.
11.Write brief on a doubly circular linked list.
12.Write the equivalent C structure to represent the node of a singly linked
list.
13.Write an algorithm for inserting a node at the beginning of singly linked
list.
14.Write an algorithm for inserting a node at the end of doubly linked list.
15.Write an algorithm to sort a singly linked list.
LONG ANSWER QUESTIONS:-
1. Construct a single linked list with 7 nodes and perform delete and display
operations.
2. Use linear search technique to write a C program to find an element in a
linked list.
3. Explain how to perform deletion operation on single linked list.
(a) At the beginning of SLL
(b) At the end of SLL
(c) At the specified position
4. Write a C program to create a doubly linked list with N elements.
5. Write a C function to insert an element into a singly linked list in all
possible cases .
6. Write the C program to create and display a double linked list
7. Explain how to perform deletion operation on double linked list.
(a)At the beginning of SLL
(b)At the end of SLL
(c)At the specified position
8. Explain how to perform insertion operation on double linked list.
(a)At the beginning of SLL
(b)At the end of SLL
(c)At the specified position
9. Explain how to perform search and replace an element operation in single
linked list.
10.Write a program to sort the given doubly linked list.
11.Explain how to perform search and replace an element operation in
double linked list.
12.Explain how to perform sort operation on single linked list.
UNIT-3
SHORT ANSWER QUESTIONS:-
1. Define the terms ‘overflow’ and ‘underflow’ in stack.
2. Which data structure follows last in first out order in processing
elements? Name the two operations of respective data structure.
3. List any three applications of stacks.
4. Define the terms PUSH and POP with respect to LIFO data structure.
5. Write about stack and its operations.
6. Convert the infix expression A/(B + C) × D into postfix notation.
7. What is stack overflow and stack underflow.
8. List the different types of expression representations along with an
example.
9. What is the postfix expression? give an example.
10.What is the prefix expression? give an example.
11.What is the infix expression? give an example.
12.If a=20, b=4 and c=3, then evaluate the postfix expression and find its
value ab+ c/
13.Evaluate the postfix expression 862/+4-
LONG ANSWER QUESTIONS:-
1. Build an equivalent postfix expression of the given infix expression (a *
b) + (c + d)/e * f.
2. Use stack to evaluate the given postfix expression “6 9 + 4 2 ^ +”.
3. Build an equivalent postfix expression of the given infix x^y /(5 * z) +2
4. Use stack to evaluate the given postfix expression “53 + 62/*35* +”.
5. Write a C program to implement stack and its operations using linked list.
6. Write the algorithm for the conversion of infix notation of expression into
postfix notation and explain it with an example.
7. Write a C program to implement stack data structure using array.
8. Write the procedure to convert the following infix expression to postfix
notation : (A+ B *C)+( D -E)* F/H.
9. Explain the operations of stack with its algorithms.
10.Write a C program to implement stack and its operations using array.
UNIT-4
SHORT ANSWER QUESTIONS:-
1. What is the principle followed by a queue for insertion and deletion?
2. Define queue by mentioning any two operations on queues.
3. List the applications of queues.
4. Define queue. List the applications of queues.
5. What is circular queue.
6. What is priority queue and its classification.
7. Mention two operations on queue.
8. Applications of priority queue.
9. Disadvantages of simple queue over circular queue.
UNIT-5
SHORT ANSWER QUESTIONS:-
1. Define the terms root, leaf and depth of the tree.
2. Consider a binary tree with at least 5 nodes and give it’s post-order
traversal.
3. List any three applications of trees.
4. Define the terms tree, degree of node and height of the tree.
5. Define the terms (a) subtree, (b) degree of tree and (c) internal node.
6. What is a binary search tree?
7. Define the terms edge, internal nodes and path
8. Define tree traversal. List various tree traversal techniques.
9. What is tree.
10.What is binary tree structure.
11.Write the importance of binary trees over general trees.
12.Explain about types of binary trees.
13.Define a)parent b)child c)sibling.
LONG ANSWER QUESTIONS:-
1. Construct a binary search tree for the given nodes : (10, 20, 34, 56, 68,
98, 33, 45) and give the in order, pre-order and post-order traversals.
2. Construct a binary tree if the in-order and post-order travels are given as
IN-ORDER : 4 2 513 6 POST-ORDER : 4 5 263 1.
3. Construct a binary search tree for the values 10, 20, 34, 56, 68, 98, 33, 45
and find out the (i) root node, (ii) leaf nodes, (iii) height of the tree and
(iv) internal nodes.
4. Construct a binary tree for the values 24, 22, 54, 11, 33, 68, 89, 91, 12, 3
and 67, and give the inorder, preorder and postorder traversals.
5. Explain various binary tree traversal algorithms with examples
6. Explain the construction of binary tree from the given inorder and
preorder traversals.
INORDER : S Q T P R X
PREORDER : P Q S T R X
7. Explain how to convert a general tree to binary tree with an example.
8. Explain in detail about an array and a linked list representation of binary
tree.
9. Explain how to perform insertion operation on a binary search tree with
an example.
10.Explain how to perform deletion operation on a binary search tree with an
example.
11.Explain how to perform search operation on a binary search tree with an
example
IMPORTANT TOPICS
Unit-1
Classification of data structure with its definition and examples
5 sorting techniques with definition, algorithm, example and its
complexity.
2 searching techniques with definition, algorithm, example and its
complexity.
Unit-2
Create, insert at begin, insert at end , insert at given position and display
operations on a single linked list with definition, algorithm and function.
delete at begin, delete at end , delete at given position and display
operations on a single linked list with definition, algorithm and function.
Create, insert at begin, insert at end , insert at given position and display
operations on a double linked list with definition, algorithm and function.
delete at begin, delete at end , delete at given position and display
operations on a double linked list with definition, algorithm and function.
Search, replace and sort operation definition, algorithm and function on a
singly/doubly linked list.
Unit-3
Stack operations with definition, algorithm and function.
Stack implemented using arrays operations with definition, algorithm and
function.
Stack implemented using linked list operations with definition, algorithm
and function.
Rules for the conversion of infix to postfix expression
Problem solving on infix to postfix conversions.
Unit-4
Queue operations with definition, algorithm and function.
Queue implemented using arrays operations with definition, algorithm
and function.
Queue implemented using linked list operations with definition,
algorithm and function.
Circular Queue implemented using arrays operations with definition,
algorithm and function.
Circular Queue implemented using linked list operations with definition,
algorithm and function.
Priority queue with classification
Unit-5
Importance of various terminology related to tree
Difference between binary and general tree
Difference between binary and binary search tree
Various traversals on binary search tree
Construct binary tree using in-order and post-order traversals
Construct binary tree using in-order and pre-order traversals
Binary tree and types