PART-A (Each 1 Mark) 20 Marks
PART-A (Each 1 Mark) 20 Marks
PART-A (Each 1 Mark) 20 Marks
ME Communication Systems- III Semester -18LM38- Data Structures and Algorithms - Quiz 1
1. The data structure required to check whether an expression contains balanced parenthesis is?
a) Stack b) Queue c) Array d) Tree
4. What data structure would you mostly likely see in a non recursive implementation of a
recursive algorithm?
a) LinkList b) Stack c) Queue d) Tree
5. The process of accessing data stored in a serial access memory is similar to manipulating data on
a ------?
a) Heap b) Binary Tree c) Array d) Stack
12. Convert the following infix expressions into its equivalent postfix expressions
(A + B ⋀D)/(E - F)+G
a) (A B D ⋀ + E F - / G +) b) (A B D +⋀ E F - / G +)
c) (A B D ⋀ + E F/- G +) d) None
13. Convert the following Infix expression to Postfix form using a stack
x + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal.
a) xyz*+pq*r+s*+ b) xyz*+pq*r+s+*
c) xyz+*pq*r+s*+ d) none
14. Which of the following statement(s) about stack data structure is/are NOT correct?
a) Stack data structure can be implemented using linked list
b) New node can only be added at the top of the stack
c) Stack is the FIFO data structure
d) The last node at the bottom of the stack has a NULL link
After the completion of all operation, the no of element present on stack are
a) 1 b) 2 c) 3 d) 4
16. The type of expression in which operator succeeds its operands is?
a) Infix Expression b) pre fix Expression
c) postfix Expression d) None
19. If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, in what
order will they be removed?
a) ABCD b) DCBA c) DCAB d) ABDC
20. Evaluate Postfix expression from given infix expression.
A + B * (C + D) / F + D * E
A. AB+CD*F/+D*E B. ABCD+*F/+DE*+
C. ABCD+*/F+DE* D. AB+CD*F/+DE*
21. Given an array Arr of size N, swap the Kth element from beginning with Kth element from end.
Example 1:
Input:
N = 8, K = 3 Arr1[] = {1, 2, 3, 4, 5, 6, 7, 8}
Output: 1 2 6 4 5 3 7 8
Explanation: Kth element from beginning is 3 and from end is 6.
22. What is a Queue, how it is different from stack and how is it implemented?
23. Find power(x,y) without using pow function.
24. Check whether a given string is a palindrome or not.
25. Write an Algorithm for the insert and delete operations on Stack of size n.
----------------------------------------------------------------------------------------