10.data Structure
10.data Structure
2) Write a Singly linked list program to sort the nodes. (add_middle prog).
3)
4) Write a program to merge two Singly linked list.
5) Write a prorgram to swap 'k'th node from begining and 'k' node from end in a Singly linked
list.
For Ex: if nodes are
A --- B --- C --- D --- E --- F --- G --- H --- I
if k = 2 , then o/p should be
A --- H --- C --- D --- E --- F --- G --- B --- I
7) Write a Singly linked list program to delete a perticular according to any signature of a
given structure.
8) Write a Singly linked list program to delete a perticular node from last and also find the
count of no.of nodes using only single traverse.
Ex: Suppose if there are 7 nodes, and if 2nd node has to be delete from last, then it is 6th
node from starting.
Before delete : A --- B --- C --- D --- E --- F --- G
After delete : A --- B --- C --- D --- E --- G
9) Write a program to delete the duplicate nodes from sorted Singly linked list.
10) Write a program to delete the duplicate nodes from unsorted Singly linked list.
11) Write a program to reverse the data of given Singly linked list.
12) Write a program to reverse the data of only first 'M' no.of nodes of 'N' no.of nodes.
Input the 'M' value during runtime.
13) Write a program to reverse the links of first 'N' no.of nodes of a given Singly linked list.
Before reverse : A --- B --- C --- D --- E --- F --- G --- H
If M = 5 then
After reverse : E --- D --- C --- B --- A --- F --- G --- H
14) Write a program to reverse all links of given Singly linked list
i) using loops ii) using recursion.
15) Write a Singly linked list program to check the given linked list is palindrome or not.
16) Write a Singly linked list program to implement Stack and Queue operations.
17) Write the Double linked list programs for the all above question.
19) Write a program to construct Binary-tree by the given nodes and print it in the order
i) pre-order ii) in-order iii)post-order
21) Write a program to delete a particular node in a given Binary-tree according to any signature
of a given structure.