Must-know algorithms for IB Comp Sci


  • Finding position of a specific item in a list
  • Find max/min from a list
  • Summing/averaging a list
  • Counting occurrences of a specific item in list
  • Grouping every N items, e.g. by month/week etc
  • Bubble sort


  • Two-dimensional array algorithms
    • Traversing
    • Transposing
  • Binary search
  • Stack (3 methods)
  • Queue (3 methods)
  • Binary tree
    • 3 traversals
    • insert

Other standard algorithms (SL and HL)

  • Palindrome: whether an array is the same backwards as forwards
  • Rotation in place: Shifting each item in an array n places forwards with elements at the end of the array wrapping round
  • Merging sorted arrays into a single sorted array
  • Fisher-Yates shuffle: randomizing an array in place

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s