[go: up one dir, main page]

0% found this document useful (0 votes)
2 views1 page

Dsa Questions

The document lists various algorithmic problems and data structure implementations, including reversing linked lists, finding the middle element, and implementing stacks and queues. It also covers sorting algorithms like merge sort and quick sort, as well as graph algorithms such as Dijkstra's and Prim's. Additionally, it includes string manipulation tasks like finding the longest common subsequence and checking for palindromes.

Uploaded by

hitechbrain7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Dsa Questions

The document lists various algorithmic problems and data structure implementations, including reversing linked lists, finding the middle element, and implementing stacks and queues. It also covers sorting algorithms like merge sort and quick sort, as well as graph algorithms such as Dijkstra's and Prim's. Additionally, it includes string manipulation tasks like finding the longest common subsequence and checking for palindromes.

Uploaded by

hitechbrain7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1. Reverse a linked list.

2. Find the middle element of a linked list.


3. Implement a stack using arrays/linked list.
4. Implement a queue using arrays/linked list.
5. Find the factorial of a number using recursion.
6. Implement binary search in an array.
7. Find the largest/smallest element in an array.
8. Implement merge sort.
9. Implement quick sort.
10. Detect a cycle in a linked list.
11. Find the intersection point of two linked lists.
12. Check if a binary tree is a binary search tree (BST).
13. Print all leaf nodes of a binary tree.
14. Reverse a binary tree.
15. Find the height of a binary tree.
16. Implement depth-first search (DFS) on a graph.
17. Implement breadth-first search (BFS) on a graph.
18. Check if a graph is connected.
19. Implement Dijkstra's algorithm for shortest path.
20. Implement Prim's algorithm for minimum spanning tree.
21. Implement Kruskal's algorithm for minimum spanning tree.
22. Find the longest common subsequence of two strings.
23. Find the longest increasing subsequence of an array.
24. Implement the Knuth–Morris–Pratt (KMP) algorithm for string matching.
25. Implement the Rabin-Karp algorithm for string matching.
26. Check if a string is a palindrome.
27. Check if two strings are anagrams of each other.
28. Find the next greater element in an array.
29. Find the kth smallest/largest element in an array.
30. Find the median of two sorted arrays.
31. Implement a trie (prefix tree).
32. Find all subsets of a set.
33. Find all permutations of a string.
34. Implement the Josephus Problem.
35. Implement an LRU (Least Recently Used) Cache.
36. Find the longest palindrome substring in a string.
37. Implement a priority queue.
38. Implement a hashmap (dictionary).
39. Count the number of inversions in an array.
40. Find the shortest path in a maze.

You might also like