Practice Questions For MTE
Practice Questions For MTE
(R1UC601B)
PRACTICE QUESTIONS FOR MTE
1. What is meant by time complexity and space complexity? Explain in detail.
2. What are asymptotic notations? Define Theta, Omega, big O, small omega, and
small o.
3. Explain the meaning of O(2^n), O(n^2), O(nlgn), O(lg n). Give one example of
each.
4. Explain sliding window protocol.
5. Explain Naive String-Matching algorithm. Discuss its time and space
complexity.
6 Explain Rabin Karp String-Matching algorithm. Discuss its time and space
complexity.
7 Explain Knuth Morris and Pratt String-Matching algorithm. Discuss its time and
space complexity.
8 What is a sliding window? Where this technique is used to solve the
programming problems.
9 What are bit manipulation operators? Explain and, or, not, ex-or bit-wise
operators.
10 Why are the benefits for linked list over arrays.
11 Implement singly linked list.
11 Implement stack with singly linked list.
12 Implement queue with singly linked list.
12 Implement doubly linked list.
13 Implement circular linked list.
14 Implement circular queue with linked list.
15 What is recursion? What is tail recursion?
16 What is the tower of Hanoi problem? Write a program to implement the Tower
of Hanoi problem. Find the time and space complexity of the program.
17 What is backtracking in algorithms? What kind of problems are solved with this
technique?
18 Implement N-Queens problem. Find the time and space complexity.
19 What is subset sum problem? Write a recursive function to solve the subset sum
problem?
20 Implement a function that uses the sliding window technique to find the
maximum sum of any contiguous subarray of size K.
21 Write a recursive function to generate all possible subsets of a given set.
22 Write a program to find the first occurrence of repeating character in a given
string.
23 Write a program to print all the LEADERS in the array. An element is a leader if
it is greater than all the elements to its right side. And the rightmost element is
always a leader.
24 Write a program to find the majority element in the array. A majority element in
an array A[] of size n is an element that appears more than n/2 times.
25 Given an integer k and a queue of integers, write a program to reverse the order
of the first k elements of the queue, leaving the other elements in the same
relative order.
26 Write a program to implement a stack using queues.
27 Write a program to implement queue using stacks.
28 Given a string S of lowercase alphabets, write a program to check if string is
Advanced Algorithmic Problem Solving
(R1UC601B)
isogram or not. An Isogram is a string in which no letter occurs more than once.