+44(0) 1234 567 890 info@domainname.com

Sunday 23 June 2013

Linked list Programming exercises in Data structure

21:40

Share it Please
 Linked list  Programming
Example :1
Make Menu and perform the following operation by the help of singly linked list?
Create a link list. (The list should be Dynamic and should stop only when the user wishes to end the creation of the list).

  • Ask User to enter  a  desire  node and  as a result the program will delete that node from the list.
  • Take a node from the user as input and insert that node after the desired node provided by the user.
  • Take an identification of a node as input  from the user and search that node from the created link list.
Source Code:

 Example :2
Make a Menu and perform the following operation using doubly linked list?
  • Create a doubly link list. (The list should be Dynamic and should stop only when the user wishes to end the creation of the list).The list can be created either in forward or backward manner.
  • Provide the option to the user for the deletion of the node (before the current node or after the current node).Take an identification of a node from the user and delete that node from the list.
  • (a)Take a node from the user and insert that node after the desired node provided by the user.(b) take a node from the user and insert that node before the desired node provided by the user.                        
  • Take an identification of a node from the user and search that node from the created doubly link list. The node can be searched by traversing the doubly link list either in forward or in backward manner.
 Source Code:

1 comments: