reading-notes


Project maintained by will-ing Hosted on GitHub Pages — Theme by mattgraham

Linked lists

Linked List - is a sequence of Nodes that are connected/linked to each other.

Types of linked lists -

Types of lists

Notables

Parts of Linked Lists

NullReferenceException gets thrown trying to traverse on a node that is null

Current - will tell us where exactly in the linked list we are and will allow us to move/traverse forward until we hit the end.

# if linked list includes a value
def Includes(value):
  Current = Head

  while Current != None:
    if Current.Value == value
      return True
    
    Next(Value)

  return False

Big O of Time for includes would be O(n) = n represents the number of nodes in the list.
Big O of space for includes would be O(1) = there is no additional space being used than what is already given to us with the linked list input.


Big O Notation

Big O Notation is a way of evaluating the performance of an algorithm.

For linked lists there is two types of Big O equations to remember are O(1) and O(n).

Main Page