hello friends,
i have some problem with the concept of singly link list,,, don't know how to read it backward
pls help
sparsh610 0 Newbie Poster
Recommended Answers
Jump to Post— TrustyTony 888You do not read singly linked list backward, that is why it is called singly linked. You would basically need to build another singly linked list reversed while reading the list from front to back. The process would be same as not in place reversing the linked list function uses.
Jump to Post— mike_2000_17 2,669if i m not wrong it means , i have to create a reverse link list and then read it , in order to read a link list in backward fashion
No. You understood AD and pyTony correctly (I think), that's what they suggested. But that is certainly …
Jump to Post— Schol-R-LEA 1,446There is another approach to this, which would not require you to rebuild the list; however, the technique needed is not that different from that used to reverse the list, so which would be the most useful would depend on the overall goal. In essence, what you would do is …
Jump to Post— Trentacle 112so if i use stack as singly linked list i dont travel reverse when i pop it ?
You traverse the list, pushing each item (or a pointer to it) onto the stack as you reach it, then pop each item off the stack. You've added a new …
Jump to Post— mike_2000_17 2,669Sorry about that, we tend to go astray when interesting issues are raised.
We can bring the conversation back down to your level (no offense), if you just give us more specific questions about what you would like clarifications on. And if you have code for this problem that you …
All 22 Replies
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
sparsh610 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Sokurenko 42 Junior Poster
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
Sokurenko 42 Junior Poster
Trentacle 112 Junior Poster in Training
Sokurenko 42 Junior Poster
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
Trentacle 112 Junior Poster in Training
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Trentacle 112 Junior Poster in Training
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
sparsh610 0 Newbie Poster
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.