0% found this document useful (0 votes)
17 views

C & DS Program

The document is a comprehensive question list for data structure programs, covering singly linked lists, doubly linked lists, circular linked lists, tree programs, and various stack operations. Each section includes multiple programming tasks aimed at implementing and manipulating these data structures. It serves as a resource for students or developers looking to practice and enhance their understanding of data structures.

Uploaded by

nothinga921
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

C & DS Program

The document is a comprehensive question list for data structure programs, covering singly linked lists, doubly linked lists, circular linked lists, tree programs, and various stack operations. Each section includes multiple programming tasks aimed at implementing and manipulating these data structures. It serves as a resource for students or developers looking to practice and enhance their understanding of data structures.

Uploaded by

nothinga921
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Techno India NJR DATA STRUCTURE Question List

Singly Linked List Programs

o Program to create and display a singly linked list


o Program to create a singly linked list of n nodes and count the number of nodes
o Program to create a singly linked list of n nodes and display it in reverse order
o Program to delete a new node from the beginning of the singly linked list
o Program to delete a new node from the middle of the singly linked list
o Program to delete a node from the end of the singly linked list
o Program to determine whether a singly linked list is the palindrome
o Program to find the maximum and minimum value node from a singly linked list
o Program to insert a new node at the middle of the singly linked list
o Program to insert a new node at the beginning of the singly linked list
o Program to insert a new node at the end of the singly linked list
o Program to remove duplicate elements from a singly linked list
o Program to search an element in a singly linked list
o Program to sort the elements of the singly linked list
o Program to swap nodes in a singly linked list without swapping data
o Program to swap the last element of the singly linked list from the first one

Doubly Linked List Programs

o Program to Convert a Given Binary Tree to Doubly Linked List


o Program to Create a Doubly Linked List From a Ternary Tree
o Program to Create a Doubly Linked List of N Nodes and Count the Number of Nodes
o Program to Create a Doubly Linked List of N Nodes and Display it in Reverse Order
o Program to Create and Display a Doubly Linked List
o Program to Delete a New Node From the Beginning of the Doubly Linked List
o Program to Delete a New Node From the End of the Doubly Linked List
o Program to Delete a New Node From the Middle of the Doubly Linked List
o Program to Find the Maximum and Minimum Value Node From a Doubly Linked List
o Program to Insert a New Node at the Beginning of the Doubly Linked List
o Program to Insert a New Node at the End of Doubly Linked List
o Program to Insert a New Node at the Middle of Doubly Linked List

By :Vijay Soni Page 1


Techno India NJR DATA STRUCTURE Question List

o Program to Remove Duplicate Elements From a Doubly Linked List


o Program to Rotate Doubly Linked List by N Nodes
o Program to Search an Element in a Doubly Linked List
o Program to Sort the Elements of the Doubly Linked List

Circular Linked List Programs

o Program to Create a Circular Linked List of N Nodes and Count the Number of Nodes
o Program to Create a Circular Linked List of N Nodes and Display it in Reverse Order
o Program to Create and Display a Circular Linked List
o Program to Delete a New Node From the Beginning of the Circular Linked List
o Program to Delete a New Node From the End of the Circular Linked List
o Program to Delete a New Node From the Middle of the Circular Linked List
o Program to Find the Maximum and Minimum Value Node From a Circular Linked List
o Program to Insert a New Node at the Beginning of the Circular Linked List
o Program to Insert a New Node at the End of the Circular Linked List
o Program to Insert a New Node at the Middle of the Circular Linked List
o Program to Remove Duplicate Elements From a Circular Linked List
o Program to Search an Element in a Circular Linked List
o Program to Sort the Elements of the Circular Linked List

Tree Programs

o Program to Calculate the Difference Between the Sum of the Odd Level and Even Level
Nodes of a Binary Tree
o Program to Construct a Binary Search Tree and Perform Deletion and Inorder Traversal
o Program to Convert Binary Tree to Binary Search Tree
o Program to Determine Whether all Leaves are at Same Level
o Program to Determine Whether two Trees are Identical
o Program to Find Maximum Width of a Binary Tree
o Program to Find the Largest Element in a Binary Tree
o Program to Find the Maximum Depth or Height of a Tree
o Program to Find the Nodes Which are at the Maximum Distance in a Binary Tree
o Program to Find the Smallest Element in a Binary Tree

By :Vijay Soni Page 2


Techno India NJR DATA STRUCTURE Question List

o Program to Find the Sum of all the Nodes of a Binary Tree


o Program to Find the Total Number of Possible Binary Search Trees with N Keys
o Program to Implement Binary Tree using the Linked List
o Program to Search a Node in a Binary Tree

Design and Implementation :


1. Implement Queue using Stacks
2. Design and Implement Special Stack Data Structure | Added Space Optimized Version
3. Implement two stacks in an array
4. Implement Stack using Queues
5. Design a stack with operations on middle element
6. How to efficiently implement k stacks in a single array?
7. How to create mergable stack?
8. Design a stack that supports getMin() in O(1) time and O(1) extra space
9. Implement a stack using single queue
10. How to implement stack using priority queue or heap?
11. Create a customized data structure which evaluates functions in O(1)
12. Implement Stack and Queue using Deque
Standard Problems based on Stack :
1. Infix to Postfix Conversion using Stack
2. Prefix to Infix Conversion
3. Prefix to Postfix Conversion
4. Postfix to Prefix Conversion
5. Postfix to Infix
6. Convert Infix To Prefix Notation
7. The Stock Span Problem
8. Check for balanced parentheses in an expression
9. Next Greater Element
10. Next Greater Frequency Element
11. Number of NGEs to the right
12. Maximum product of indexes of next greater on left and right
13. The Celebrity Problem
14. Expression Evaluation
15. Arithmetic Expression Evalution
16. Evaluation of Postfix Expression
17. Iterative Tower of Hanoi
18. Print next greater number of Q queries
Operations on Stack :
1. Reverse a stack using recursion
2. Sort a stack using recursion
3. Sort a stack using a temporary stack
4. Reverse a stack without using extra space in O(n)
5. Delete middle element of a stack
6. Sorting array using Stacks
7. Delete array elements which are smaller than next or become smaller
8. Check if a queue can be sorted into another queue using a stack
9. Reverse individual words
10. Count subarrays where second highest lie before highest

By :Vijay Soni Page 3


Techno India NJR DATA STRUCTURE Question List

11. Check if an array is stack sortable


Misc :
1. Iterative Postorder Traversal | Set 1 (Using Two Stacks)
2. Iterative Postorder Traversal | Set 2 (Using One Stack)
3. Merge Overlapping Intervals
4. Largest Rectangular Area in a Histogram | Set 2
5. Print ancestors of a given binary tree node without recursion
6. Reverse a string using stack
7. Program for Tower of Hanoi
8. Find maximum depth of nested parenthesis in a string
9. Find maximum of minimum for every window size in a given array
10. Length of the longest valid substring
11. Iterative Depth First Traversal of Graph
12. Minimum number of bracket reversals needed to make an expression balanced
13. Expression contains redundant bracket or not
14. Identify and mark unmatched parenthesis in an expression
15. Check if two expressions with brackets are same
16. Find index of closing bracket for a given opening bracket in an expression
17. Check for balanced parentheses in an expression
18. Balanced expression with replacement
19. Check if a given array can represent Preorder Traversal of Binary Search Tree
20. Form minimum number from given sequence
21. Find if an expression has duplicate parenthesis or not
22. Find maximum difference between nearest left and right smaller elements
23. Find next Smaller of next Greater in an array
24. Find maximum sum possible equal sum of three stacks
25. Count natural numbers whose all permutation are greater than that number
26. Delete consecutive same words in a sequence
27. Decode a string recursively encoded as count followed by substring
28. Bubble sort using two Stacks
29. Pattern Occurrences : Stack Implementation Java
30. Iterative method to find ancestors of a given binary tree
31. Stack Permutations (Check if an array is stack permutation of other)
32. Tracking current Maximum Element in a Stack
33. Check mirror in n-ary tree
34. Reverse a number using stack
35. Reversing the first K elements of a Queue
36. Reversing a Queue
37. Check if stack elements are pairwise consecutive
38. Spaghetti Stack
39. Interleave the first half of the queue with second half
40. Remove brackets from an algebraic string containing + and – operators
41. Growable array based stack
42. Range Queries for Longest Correct Bracket Subsequence

By :Vijay Soni Page 4

You might also like