0
votes

For homework I had to create a doubly linked list and make a small application that uses the data structure. Previously I had a similar homework with a Stack data structure, so I created a parenthesis matching app.

Can anyone suggest me a small app that could use a doubly linked list and that it shows how its better to use a doubly linked list over a single linked list.

Thanks

2
Have a look at this SO article which does a good job of discussing the differences between single- and doubly-linked lists.Tim Biegeleisen

2 Answers

3
votes

Think of the Back - Forward buttons of your web browser. The browser keeps a history of the links you have visited in a doubly linked list.

0
votes

Make an application that stores names and phone numbers (as one example) and then give it the capability to output them in both ascending and descending order (based on name).

While a singly linked list would be efficient in one direction, the doubly linked version would be efficient in both.