Data Structures Important Questions Answers

  1. What do you mean by data structure? Explain various types of data structures.
  2. What do you mean by operations of data structure? Explain various types of operations that can be performed on data structures.
  3. What do you mean by Analysis of an Algorithm? Explain Worst Case, Average Case and Best Case Complexity.
  4. What do you mean by Time and space complexity? Explain trade off situation between them.
  5. What do you mean by searching and its types.
  6. What are the conditions for Binary Search? Which searching is better and why?
  7. What do you mean by sorting? Explain various types of sorting with their complexities.
  8. Given array is 23, 45, 32, 21. Write the steps to :
  9. Given array is 10, 20, 30, 40, 50 Write the steps to
  10. Explain different types of complexities worst case, average case and best case for linear and binary search.
  11. Write algorithm/function for linear search
  12. Write algorithm/function for binary search
  13. What do you mean by sparse matrix? How they are stored in memory to save the storage space.
  14. What do you mean by array? How 1 dimensional array is stored in memory.
  15. How two dimensional arrays are stored in memory? Explain row major and column major forms to find the address of any element.
  16. Two Dimensional Array Address calculation Questions
  17. Evaluate the following postfix notation of expression (Show status of stack after execution of each operation ): 4, 10, 5, +, *, 15, 3, /, –
  18. Evaluate the following postfix notation of expression : 20 10 + 5 2 * – 10 /
  19. Evaluate the following postfix notation of expression (Show status of stack after execution of each operations): 5, 20, 15, -, *,25, 2, *, + 2
  20. Evaluate the following postfix notation of expression : 25 8 3 – / 6 * 10 + (2)
  21. Evaluate the following postfix expression using a stack and show the contents of stack after execution of each operation: 20, 45, +, 20, 10, -, 15, +, *
  22. Evaluate the following postfix notation of expression : 15 3 2 + / 7 + 2. * .
  23. Write the equivalent infix expression for 10, 3, *, 7, 1, –,*, 23, +
  24. Write the equivalent infix expression for a, b, AND, a, c, AND, OR
  25. Evaluate the following postfix notation of expression : 10 20 + 25 15 – * 30 /
  26. Write the equivalent prefix and postfix expression for the given infix expressions :
    • A + B – D / X x Y
    • (X + Y) / (Z x Y) – R
  27. Evaluate the following postfix expression and show the contents of stack after execution each operation :
    • 20  10  +  25 10  – * 5 /
    • 20  10  +  55 5 * – 10 /
    • 120,45,20,+25,15,-,+,*
    • 60,45,+,20,10,-,5,-,10,+,*
    • 60,6,/,5,2,*,5,-,+
    • 5,3,+,2,*,6,9,7,-,/,-
    • 3,1,+,2,🡩,7,4,-,2,*,+,5,-
    • T, F, NOT, AND, T, OR , F, AND
    • True, False, NOT, AND, False, True, OR, AND
  28. Convert the following infix expression to its equivalent postfix expression showing stack contents for the conversion :
    • A + B * (C – D) / E
    • X – Y / (Z + U ) * V
    • (A + B) * C + D / E – F
    • A * (B + (C + D) * (E + F) / G) * H
    • A + [(B + C)+ (D + E) * F] / G
    • A + B * C 🡩 (D / E) /F
    • NOT A OR NOT B AND NOT C
    • NOT (A OR B) AND C
    • ( A + B 🡩 D) / (E – F) + G
  29. Obtain the postfix notation for the following infix notation of expression showing the contents of the stack and postfix expression formed after each step of conversion : (P—Q)/(R*(S—T)+U)
    Ans: Postfix Form: PQ-RST-*U+/
    Solution:
S.N
o
Symbol
Scanned
StackExpression Y
1(( 
2((( 
3P((P
4((-P
5Q((-P Q
6)(P Q –
7/(/P Q –
8((/(P Q –
9((/((P Q –
10R(/((P Q –
11*(/((*P Q – R
12((/((*(P Q – R
13S(/((*(P Q – R
14(/((*(-P Q – R S 
15T(/((*(-P Q – R S 
16)(/((*P Q – R S T
17)(/(P Q – R S T – 
18+(/(+P Q – R S T – * 
19U(/(+P Q – R S T – * U +
20)(/P Q – R S T – * U+ 
21) P Q – R S T – * U+ /
error: You can only copy the programs code and output from this website. You are not allowed to copy anything else.