reading-notes

Code Fellows Notes

View the Project on GitHub stephnitis/reading-notes

Data Structures and Algorithms

Recursion

Every recursive function has two parts:

  1. The base case: when the function doesn’t call itself again
  2. The recursive case: when the function calls itself, what will keep happening if the base case has not been reached.

DATA STRUCTURES you MUST know (as a Software Developer)

1. Linked List

2. Array

3. Hash Table

4. Stack and Queue

5. Graphs and Trees

Big O Explained

Four Important Rules:

  1. If you have two different steps in your algorithm you add up those steps
  2. Drop constants
  3. If you have different inputs they are usually going to use different variables to represent them.
  4. Drop non-dominant terms

8 Common Data Structures every Programmer must know

1. Arrays

2. Linked Lists

Types of linked lists available:

Linked list operations:

3. Stacks

4. Queues

5. Hash Tables

h(k) = k % m

6. Trees

Binary Search Trees

Heaps

Two Types:

  1. Min Heap — the key of the parent is less than or equal to those of its children. This is called the min-heap property. The root will contain the minimum value of the heap.
  2. Max Heap — the key of the parent is greater than or equal to those of its children. This is called the max-heap property. The root will contain the maximum value of the heap.

Graphs

Directed Graphs

Undirected Graphs

Big O Cheatsheet

Why you should learn Big-O and stop hacking your way through algorithms

Discussion Questions

  1. What is 1 of the more important things you should consider when deciding which data structure is best suited to solve a particular problem?

The size of the data. The size of the storage. The data dynamics, such as changing or editing the data.

  1. How can we ensure that we’ll avoid an infinite recursive call stack?

You must define when your function is to stop recursing.

Things I want to know more about

Right now some of these concepts feel a bit abstract, and I would like to see them put to use. Graphs for example make sense in theory but I would like to understand them in implementation.