Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

DSA sample paper excerise, Exams of Data Structures and Algorithms

DSA Using C Year 2024 By the exericse

Typology: Exams

2023/2024

Uploaded on 08/03/2024

taran-trivedi
taran-trivedi 🇮🇳

1 document

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1. Derive the formula to find physical address of an element of three dimensional
array stored in row major order.
2. What do you mean by complexity? Explain time complexity and space complexity
and write down time-space trade off.
3. What is sparse matrix? Explain. Write the applications of sparse matrix?
4. Consider the linear array, A(5:50), whose base address is 300 and the number of
words per memory cell is 4. Find the address of A[15].
5. Consider the linear arrays AAA[5:50],BBB[-5:10] and CCC[1:8]
a. Find the number of elements in each array?
b. Suppose base (AAA) =300 and w=4 words per memory cell for AAA. Find the
address of AAA[15],AAA[35] and AAA[55].
6. Describe various form of data structure. Define data structure and also describe the
difference between primitive and non-primitive data structure. Write most
commonly used function in data structure. What are the factors that affect the
choice of data structure?
7. Define Linked List? What are the applications of Linked List?
8. Explain the method to represent the polynomial equation using Iinked list. Write
and explain method to add two polynomial equations using linked list.
9. Write a C function to count the number of nodes in singly linked list?
10. What are advantages and disadvantages of doubly linked list over singly linked list?
11. Explain Garbage Collection and Compaction.
12. What do you mean by Stack? Explain with suitable example with all its operation.
How stack can be represented in memory?
13. State the Tower of Hanoi problem. Write recursive algorithm to solve the problem.
14. Write an algorithm to convert INFIX expression to postfix expression. Carefully
state any assumption you make regarding the input.
15. Write the algorithm to evaluate a postfix expression using a stack.
16. Write an algorithm to convert a valid arithmetic infix expression into its equivalent
postfix expression.
17. Convert the following arithmetic expression into postfix and show stack status after
every step in tabular forms: A+(B*C-(D/E-F)*G)*H
18. Write an algorithm for evaluating an expression in postfix form. Consider the
following infix expression ((a+b)+c^ (d+e)+f)^(g+h) Convert the expression to
equivalent prefix expression and postfix expression.
19. Convert the following arithmetic expression into postfix and show stack status after
every step at each step:
a. (A+B)*D+E / (F+A*D)+
b. A*(B+C) / D- G
c. 3* LOG (X+1) –A/2
20. Explain queue data structure. Write an algorithm and c function to implement
Queue using Array and Linked list. Write algorithm for performing insertion and
deletion in it.
21. Show, how a priority queue can be implemented using linked list.
22. How would you implement a circular queue of integers in C using array? Write
routines to implement the appropriate operations for it.
23. Discuss the array representation of the binary tree
24. Draw binary tree of following algebraic equation:
[a + (b - c)] * [(d - e) / (f + g - h)]
pf3

Partial preview of the text

Download DSA sample paper excerise and more Exams Data Structures and Algorithms in PDF only on Docsity!

  1. Derive the formula to find physical address of an element of three dimensional array stored in row major order.
  2. What do you mean by complexity? Explain time complexity and space complexity and write down time-space trade off.
  3. What is sparse matrix? Explain. Write the applications of sparse matrix?
  4. Consider the linear array, A(5:50), whose base address is 300 and the number of words per memory cell is 4. Find the address of A[15].
  5. Consider the linear arrays AAA[5:50],BBB[-5:10] and CCC[1:8] a. Find the number of elements in each array? b. Suppose base (AAA) =300 and w=4 words per memory cell for AAA. Find the address of AAA[15],AAA[35] and AAA[55].
  6. Describe various form of data structure. Define data structure and also describe the difference between primitive and non-primitive data structure. Write most commonly used function in data structure. What are the factors that affect the choice of data structure?
  7. Define Linked List? What are the applications of Linked List?
  8. Explain the method to represent the polynomial equation using Iinked list. Write and explain method to add two polynomial equations using linked list.
  9. Write a C function to count the number of nodes in singly linked list?
  10. What are advantages and disadvantages of doubly linked list over singly linked list?
  11. Explain Garbage Collection and Compaction.
  12. What do you mean by Stack? Explain with suitable example with all its operation. How stack can be represented in memory?
  13. State the Tower of Hanoi problem. Write recursive algorithm to solve the problem.
  14. Write an algorithm to convert INFIX expression to postfix expression. Carefully state any assumption you make regarding the input.
  15. Write the algorithm to evaluate a postfix expression using a stack.
  16. Write an algorithm to convert a valid arithmetic infix expression into its equivalent postfix expression.
  17. Convert the following arithmetic expression into postfix and show stack status after every step in tabular forms: A+(BC-(D/E-F)G)*H
  18. Write an algorithm for evaluating an expression in postfix form. Consider the following infix expression ((a+b)+c^ (d+e)+f)^(g+h) Convert the expression to equivalent prefix expression and postfix expression.
  19. Convert the following arithmetic expression into postfix and show stack status after every step at each step: a. (A+B)D+E / (F+AD)+ b. A(B+C) / D- G c. 3 LOG (X+1) –A/
  20. Explain queue data structure. Write an algorithm and c function to implement Queue using Array and Linked list. Write algorithm for performing insertion and deletion in it.
  21. Show, how a priority queue can be implemented using linked list.
  22. How would you implement a circular queue of integers in C using array? Write routines to implement the appropriate operations for it.
  23. Discuss the array representation of the binary tree
  24. Draw binary tree of following algebraic equation: [a + (b - c)] * [(d - e) / (f + g - h)]
  1. A recursive function f is shown below. What is the value of f(5)?int f (int x) { if (x<2) return 1; else return f(x-1)+f(x-2); }
  2. Comparison between Array and Linked List.
  3. Write an algorithm to insert and delete a node from doubly linked list. Illustrate with an example.
  4. What is the need of different type of data structure?
  5. What is the advantage of linked list over array? Explain in brief.
  6. Discuss some application of asymptotic analysis of algorithm.
  7. Differentiate between time complexity and space complexity of an algorithm.
  8. A two dimensional array GU [6][8] is stored ion row major order with base address
    1. What is the address of GU[3][4].
  9. What are the parameters to judge the efficiency of an algorithm?
  10. Write the merits and demerits of static and dynamic memory allocation?
  11. What do you understand by the term algorithm? Describe the characteristics of an algorithm.
  12. Write the traversing algorithm for linear array.
  13. What is doubly link list? Write a c program to insert a new node at the end of a doubly linked list.
  14. Write a procedure to that concatenates two circular linked list into one circular link list.
  15. Write an algorithm and C function to reverse a single link list
  16. Write a program in C to implement a queue using linked list. Your program should at least contain ADD, CREATE, DELETE, FULL and EMPTY function.
  17. Give an equivalent postfix expression for the following infix expression (A+B) – (C+DE)/FG.
  18. Which data structure used for implementing recursion? Why.
  19. Distinguish between ordinary queue and circular queue.
  20. Define polish notation with example.
  21. Explain a circular queue. What is the condition of if the circular queue is full?
  22. Explain queue with suitable example. Also give procedure to insert and delete an element from queue.
  23. Write a program in C to find the Greatest Common Divisor of two positive number using recursion functions.
  24. Write a function for conversion of an infix expression to postfix expression.
  25. What is recursion? Write a program to solve Tower of Hanoi problem.
  26. Define stack. Write a c program to implement stack using array.
  27. What do you understand by tail recursion? Give example. Discus its significance.
  28. Show the detailed content of the stack for given postfix expression to evaluate 6 2 3 + - 3 8 2 / + * 2 ^ 3 + a) Draw the expression tree of the following infix expression. Convert it into prefix and post fix expression. ((a + b) + c* (d + e) + f) * (g + h)