Solve any one question from Q.1(a,b) &Q.2(a,b)
1(a)
Sort the following data using merge sort and selection sort.
142 317 45 222 187
142 317 45 222 187
6 M
1(b)
What will be the output of the following code? Justify your answer.
for(i=0;i<4;i++)
{
for(j=0;j<4;j++)
{
a[i][j]=20 * (i+j);
printf("%d",a[i] [j]);
}
printf("\n");
}
printf('%d%d",i,j);
for(i=0;i<4;i++)
{
for(j=0;j<4;j++)
{
a[i][j]=20 * (i+j);
printf("%d",a[i] [j]);
}
printf("\n");
}
printf('%d%d",i,j);
6 M
2(a)
Write the following functions in 'C' :
i) STRCOPY ( ) To copy a string to another string using array.
ii) STRLENGTH ( ) To find length of string using array.
Note: Do not use Binary search with example.
i) STRCOPY ( ) To copy a string to another string using array.
ii) STRLENGTH ( ) To find length of string using array.
Note: Do not use Binary search with example.
6 M
2(b)
Explain Algorithm Binary search with example.
6 M
Solve any one question from Q.3(a,b,c) &Q.4(a,b,c)
3(a)
Convert the given infix expression to postfix expression using stack.
(a$b)*c-d/d
Note : $ = Exponent operator
(a$b)*c-d/d
Note : $ = Exponent operator
5 M
3(b)
Define Queue and explain any one application of Queue.
4 M
3(c)
Differentiate Single Linked List and Doubly Linked List.
4 M
4(a)
Write a 'C' function to delete a number from singly linked list.
5 M
4(b)
Explain Stack operations PUSH and POP with example.
4 M
4(c)
Compare array and linked list.
4 M
Solve any one question from Q.5(a,b) &Q.6(a,b)
5(a)
Construct the binary search tree from the following elements:
12, 8, 25, 14, 9, 6, 18. Also show preorder, inorder and postorder traversal for the same.
12, 8, 25, 14, 9, 6, 18. Also show preorder, inorder and postorder traversal for the same.
6 M
5(b)
Define Binary Tree. Name and explain with suitable example the following terms:
i) Root node
ii) Left sub-tree and Right sub-tree
iii) Depth of tree.
i) Root node
ii) Left sub-tree and Right sub-tree
iii) Depth of tree.
6 M
6(a)
Define the following terms with example with respect to Binary Tree:
i) Strictly Binary Tree
ii) Completely Binary Tree
iii) Binary Search Tree.
i) Strictly Binary Tree
ii) Completely Binary Tree
iii) Binary Search Tree.
6 M
6(b)
Explain the different cases to delete an element from binary search tree.
6 M
Solve any one question from Q.7(a,b) &Q.8(a,b)
7(a)
Explain with suitable example, BFS and DFS traversal of a graph.
6 M
7(b)
What is MST? Explain with suitable example Kruskal's Algorithm to find out MST.
7 M
8(a)
Explain with suitable example the techniques to represent a Graph.
Note: Consider Graph of minimum 6 vertices.
Note: Consider Graph of minimum 6 vertices.
6 M
8(b)
!mage
Find shortest path from node A to all nodes in the graph shown in Fig. 1 using Dijkstra's algorithm.
Find shortest path from node A to all nodes in the graph shown in Fig. 1 using Dijkstra's algorithm.
7 M
More question papers from Data Structures & Algorithms