Linked lists

325 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
325
On SlideShare
0
From Embeds
0
Number of Embeds
102
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Linked lists

  1. 1. Linked Lists
  2. 2. Multiple items?• Multiple names – FredsHouse, JohnsHouse, PetersHouse – Problems?• Arrays – House[1], House[2], House[3] – Benefits? – Problems?• Indirect Addressing
  3. 3. Drawbacks of Arrays• Not flexible• Think about deleting an item from an array• Only allow linear/grid arrangements• Require you to plan – how big will it be? (very hard to make bigger)
  4. 4. Linked listsThis is a big improvement Why?
  5. 5. Linked listsWhat’s missing?
  6. 6. Linked lists
  7. 7. Exercise• Write pseudo-code for the following linked list operations: 1. Insert an item between nodes 3 and 4 2. Delete node 3 3. Find out how many items there are in the list 4. Reverse the order of the items.

×