MODULE-2
1. Differentiate between 1) Stack and Queue. (2) Array and Link list.
2. List the advantages of a doubly linked list over singly linked list.
3. A two dimensional array is stored row by row, then what is the address of matrix element A[i,j] for n row and m column matrix? How array representation of polynomial 2x2+5xy+y2 can be done?
4. Which data structure is used in a time sharing single central processing unit and one main memory computer system where many users share the system simultaneously? How users are added for use of the system?
5. What is the problem with sign and magnitude representation if addition of +7 with -6 is performed? Evaluate 7+7 using 2’s complement representation and modulo 16 arithmetic.
6. Write an algorithm for (1) calculating the square of the number for all the prime numbers ranging between 1 to n. Perform time and space analysis. (2) convert an infix expression to a postfix expression. Show the working of the algorithm for the following expression. A+B*C/D$E-(F*G) (3) swap two nodes, n and n+1, in a singly linked list (4) to count the number of nodes in a singly circular linked list (5) for Push and Pop operations on a stack. (6) to convert Infix Expression(without parenthesis) into Postfix Expression (7) Insert and Delete operation in Circular Queue. (8) INSERT, DELETE and DISPLAY function of Circular Queue. (9) inserting an element in a circular queue and deleting a node from a singly linked list. (10) insertion and deletion of a node in Doubly Linked List. (11) insertion of nodes at last position in Linear Linked List.
7. Given a linked list whose typical node consists of an INFO and LINK field. Formulate an algorithm which will count the number of nodes in the list.
8. What is the need of a doubly linked list? Consider a problem of inserting a node into a doubly linked linear list to the left of a specified node whose address is given by variable M. Give details of algorithm.
9. Solve the Given: (i) In which case insertion and deletion cannot be performed in stack? (ii) How stack can be used to recognize strings acm, bcb, abcba, bacab, abbcbba? Show the trace of contents of stack for recognizing the string abcba. (iii) Convert a+b*c-d/e*h to postfix. (iv) Convert ((a+b^c^d)*(e+f/d)) to postfix. (v)Which stack operations are needed for performing conversion from infix to postfix? Write the algorithm.
10. What is the difference between serial and sequential processing? How can a record be deleted in a sequential file?
11. Convert Infix Expression A ^ B * C - D + E / F / (G + H) into Postfix expression using stack OR Evaluate the following postfix expression using a stack. Show the steps. 2 $ 3 + 5 * 2 $ 2 – 12 $ 6. OR Evaluate the Postfix Expression 6 2 3 + - 3 8 2 / + * 2 $ 3 + using Stack.
12. Consider the stack S of characters, where S is allocated 8 memory cells. S: A,C,D, F, K, _, _, _ Describe the stack as the following operations take place. Pop(), Pop() ,Push(L), Push(P), Pop(), Push(R), Push (S), Pop()
13. Write a program to implement 1) queue and check for boundary conditions 2) a circularly linked list
14. List the advantages of a doubly linked list over singly linked list.
15. What is Recursion? Write a pseudocode in ‘C’ language to find the multiplication of two natural numbers.
16. Write a pseudocode for PUSH and POP operations of stack.
17. Illustrate the working of priority queue with suitable examples.
18. Write a recursive algorithm to compute the factorial of a given number. Which data structure can be used to implement this algorithm? OR Write a recursive function to compute the factorial of a number. Show usage of STACK in recursion for this function.
19. Explain the working of the Prim’s algorithm with suitable examples.
20. Write a C program to reverse a string using stack.
21. Discuss various types of data structures with examples.
22. What is time and space analysis? State and explain time analysis for linear search and binary search method.
23. State disadvantages of simple queue. How to overcome it?
24. State at least one efficient representation of a sparse matrix.
0 Comments