Assignment For MTE
Assignment For MTE
1/3
17. Calculate how much water can be trapped between the bars of a histogram. Write its
algorithm, program. Find its time and space complexities. Explain with suitable
example.
18. Find the maximum XOR of two numbers in an array. Write its algorithm, program.
Find its time and space complexities. Explain with suitable example.
19. How to find the maximum product subarray. Write its algorithm, program. Find its time
and space complexities. Explain with suitable example.
20. Count all numbers with unique digits for a given number of digits. Write its algorithm,
program. Find its time and space complexities. Explain with suitable example.
21. How to count the number of 1s in the binary representation of numbers from 0 to n.
Write its algorithm, program. Find its time and space complexities. Explain with
suitable example.
22. How to check if a number is a power of two using bit manipulation. Write its algorithm,
program. Find its time and space complexities. Explain with suitable example.
23. How to find the maximum XOR of two numbers in an array. Write its algorithm,
program. Find its time and space complexities. Explain with suitable example.
24. Explain the concept of bit manipulation and its advantages in algorithm design.
25. Solve the problem of finding the next greater element for each element in an array.
Write its algorithm, program. Find its time and space complexities. Explain with
suitable example.
26. Remove the n-th node from the end of a singly linked list. Write its algorithm, program.
Find its time and space complexities. Explain with suitable example.
27. Find the node where two singly linked lists intersect. Write its algorithm, program.
Find its time and space complexities. Explain with suitable example.
28. Implement two stacks in a single array. Write its algorithm, program. Find its time and
space complexities. Explain with suitable example.
29. Write a program to check if an integer is a palindrome without converting it to a string.
Write its algorithm, program. Find its time and space complexities. Explain with
suitable example.
30. Explain the concept of linked lists and their applications in algorithm design.
31. Use a deque to find the maximum in every sliding window of size K. Write its
algorithm, program. Find its time and space complexities. Explain with suitable
example.
32. How to find the largest rectangle that can be formed in a histogram. Write its algorithm,
program. Find its time and space complexities. Explain with suitable example.
33. Explain the sliding window technique and its applications in array problems.
34. Solve the problem of finding the subarray sum equal to K using hashing. Write its
algorithm, program. Find its time and space complexities. Explain with suitable
example.
2/3
35. Find the k-most frequent elements in an array using a priority queue. Write its
algorithm, program. Find its time and space complexities. Explain with suitable
example.
36. Generate all subsets of a given array. Write its algorithm, program. Find its time and
space complexities. Explain with suitable example.
37. Find all unique combinations of numbers that sum to a target. Write its algorithm,
program. Find its time and space complexities. Explain with suitable example.
38. Generate all permutations of a given array. Write its algorithm, program. Find its time
and space complexities. Explain with suitable example.
39. Explain the difference between subsets and permutations with examples.
40. Solve the problem of finding the element with maximum frequency in an array. Write
its algorithm, program. Find its time and space complexities. Explain with suitable
example.
41. Write a program to find the maximum subarray sum using Kadane’s algorithm.
42. Explain the concept of dynamic programming and its use in solving the maximum
subarray problem.
43. Solve the problem of finding the top K frequent elements in an array. Write its
algorithm, program. Find its time and space complexities. Explain with suitable
example.
44. How to find two numbers in an array that add up to a target using hashing. Write its
algorithm, program. Find its time and space complexities. Explain with suitable
example.
45. Explain the concept of priority queues and their applications in algorithm design.
46. Write a program to find the longest palindromic substring in a given string. Write its
algorithm, program. Find its time and space complexities. Explain with suitable
example.
47. Explain the concept of histogram problems and their applications in algorithm design.
48. Solve the problem of finding the next permutation of a given array. Write its algorithm,
program. Find its time and space complexities. Explain with suitable example.
49. How to find the intersection of two linked lists. Write its algorithm, program. Find its
time and space complexities. Explain with suitable example.
50. Explain the concept of equilibrium index and its applications in array problems.
3/3