Skip to content

Instantly share code, notes, and snippets.

@craigjbass
Created September 9, 2016 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigjbass/2935f2b7179a2e69cecbca1079c8dd92 to your computer and use it in GitHub Desktop.
Save craigjbass/2935f2b7179a2e69cecbca1079c8dd92 to your computer and use it in GitHub Desktop.

Create three implementations of a simple list data structure:

  • A singly linked list
  • A doubly linked list
  • A list with no form of linking

#Each node has:

Metadata: e.g. link to next node (Metadata can contain anything that you need to make the list work)

Data: a string payload (Data contains only the string payload)

Objectives:

A node can be added to the end of the list Any node can be removed from the list The list can be asked to return all the nodes' values as an array The list can be searched for a payload, if found it returns the node that contains that payload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment