File

advertisement
Question banks
1. What is algorithm? Write conventions used to design algorithm. (Most IMP).
Explain Case statement with appropriate example.
2. Write an algorithm to multiply two matrices. Consider that the algorithm should take
size as an input.
3. Differentiate the following:
1. Linear v/s non-linear
2. Primitive v/s Non-primitive
4. What do you mean by data structure? List the problems related with data stricture and
lists its four sub problems in brief manner.
5. Explain time analysis of algorithm.
6. Explain recursion with example. Explain the application of the same in data structure.
7. Explain static v/s dynamic memory allocation.
8. Write an algorithm to search an array containing N elements for the location
containing value x. calculate the best case, worse case and average case.
1. Write an algorithm for PUSH, POP and PEEP operations on stack.
2. Write a complete program to implement stack with all its manipulation operations
like push(), pop(). Also implement a function to delete an element from a given
stack.
3. Evaluate the expression 356*+2^89-+ showing all necessary steps.
4. Write a C program to evaluate prefix expression.
5. Write an algorithm to convert infix to postfix expression (with parenthesis) with
explanation.
6. Write a complete program in C to evaluate postfix expression.
7. Explain recursion as an application of stack.
8. Convert the following into postfix notation using stack.
1. (A + B) * C / D + E ^ F / 4
2. A + ( B * C – (D / E ^ F) * 4) * H
9. Evaluate the following post fix expression in tabular form showing stack after
each step.
1. 9 3 4 / + 8 6 * -
2. 8 5 + 9 * 6 1 - ^ 2 +
10. Write an algorithm to evaluate prefix expression.
11. Evaluate “ A B + C – B A + C ^ - ” expression using stack.
1. Explain priority queue and list the application of queue.
2. Write a program in C to implement queue.
3. Write an algorithm for insert and delete an element from circular queue.
4. Write an algorithm to implement a circular queue.
5. What are the limitations of a simple queue and give the remedy for the same.
6. Write a C program to create a simple queue and insert an element at given
position.
1. Write a complete program in C to implement singly link list.
2. Write a complete program in C to implement ordered link list.
3. Write an algorithm to insert a node in ordered link list.
4. Write a program to remove all even numbers from a singly link list
5. Write a program to merge two link lists and the resultant list should be sorted in
descending order.
1. Write an algorithm to delete a node from doubly link list.
2. Write a complete program in C to implement doubly link list.
3. Write an algorithm to insert a node in a doubly link list.
4. Write a complete program to implement circular doubly linked list with the
operation to add node, delete node, traverse forward, traverse backward through
the list.
5. Discuss the advantages of doubly link list in brief.
1. Write a sub algorithm to insert an item in circular link list at last position.
2. Write a sub algorithm to delete an item from circular link list.
1. define following terms:
a. Multi graph
b. Depth of tree
c. Almost complete binary tree
d. Semi leaf node
e. Isolated node
f. Mixed graph
g. Complete binary tree
h. Out degree of node
i. Balanced binary tree
j. Directed graph
k. Threaded binary tree
l. Cycle
m. Graph
n. Weighted graph
o. Path
p. Level of tree
2. Write a function to traverse a tree by using pre order traversal method without
recursion.
3. Explain the situations when binary tree becomes unbalanced. Also explain how to
rebalance it.
4. Define top down multi way search tree. Create it using following elements of
order 5:
20 65 72 15 90 85 10 70
5 77 87 17 88 11 75 30
5. Insert the keys 43, 120, 58, 70 in the following B- tree of order 5.
5 10 15 70 80 90 95
6. Write an algorithm to traverse the tree in inorder and postorder fashion without
using recursion.
7. (i) Insert keys 382, 518, 508 in following B-tree of order 5.
380 395 406 412 493 506 511
(ii) Also delete the key 493.
8. Explain all traversal methods in binary search tree with example.
9. What do mean by thread in binary search tree? Also state the significance of the
same and draw the threads for the following tree.
4
Sorting & searching:
1. Write an algorithm for bubble sort
2. Write an algorithm to search an element from array using linear search and binary
search method.
3. Write the steps to sort the following elements using bubble sort method.
95, 32, 71, 5, 65, 38, 64, 55, 11, 97, 90, 87.
4. Write down steps the following elements using quick sort method
13, 19, 9, 5, 12, 8, 7, 4.
5. Give time complexity for the following sorting methods.
a. Bubble sort
b. Quick sort
c. Selection sort
d. Simple merge sort
6. Write a C program to implement selection sort.
7. Sort the given sequence of elements using Partition Exchange sort algorithm.
Mention all pointer stages.
25, 57, 48, 37, 12, 92, 90, 86, 99, 14, 6, 53, 11
File structure and hashing:
1. Explain different file organization in brief.
2. What is hashing? Explain hash collision and methods of removing hash collision.
3. What is hashing? Explain primary clustering.
4. Give difference between sequential and random access file structure.
Download