Traversing in doubly linked listTraversing is the most common operation in case of each data structure. For this purpose, copy the head pointer in any of the temporary pointer ptr. then, traverse through the list by using while loop. Keep shifting value of pointer variable ptr until we find the last node. The last node contains null in its next part. Although, traversing means visiting each node of the list once to perform some specific operation. Here, we are printing the data associated with each node of the list. Algorithm
  WRITE "UNDERFLOW" C FunctionOutput 1.Append List 2.Traverse 3.Exit 4.Enter your choice?1 Enter the item 23 Node Inserted 1.Append List 2.Traverse 3.Exit 4.Enter your choice?1 Enter the item 23 Press 0 to insert more ? Node Inserted 1.Append List 2.Traverse 3.Exit 4.Enter your choice?1 Enter the item 90 Press 0 to insert more ? Node Inserted 1.Append List 2.Traverse 3.Exit 4.Enter your choice?2 90 23 23
Next TopicDoubly Linked List
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week