Data Structures and Algorithms

Learning Data Structures and Algorithms is important in Computer Science because they allow you to solve challenging problems.

Data Structures and Algorithms Resources that I have used:

  1. Data Structures & Algorithms in Python Book - Goodrich
  2. The Algorithm Design Manual - Steven Skiena
  3. CS Dojo youtube videos
  4. mycodeschool youtube channel

Link to my GitHub Repository:

Data Structures and Algorithms Repository

Algorithm Analysis

bigO

Big O Notation

Algorithms:

Sorting Algorithms

Insertion Sort

Merge Sort

Quick Sort

Bubble Sort

Project using Sorting Algorithms coming soon!

Sorting Algorithm Complexity

Algorithm Running Time (Average) Running Time (Worst) Space Complexity (Worst)
QuickSort (n log(n)) O (n^2) O(n log(n))
Insertion Sort (n) O (n^2) O(1)
Merge Sort (n log(n)) O(n log(n)) O(n)
Bubble Sort (n) O (n^2) O(1)

Data Structures:

Arrays:

inserting an Image

Intro to Arrays

  • The Simplest Data Structure

Stacks and Queues

inserting an Image

Stacks

inserting an Image

Queues

  • Deques

  • Circular Queue

Linked Lists

inserting an Image

Linked Lists

  • Includes:

Singly Linked Lists:

  • Insertion, Deletion, Find the Nth-to-last Node, Length of Singly Linked List
  • Rotate around a Pivot, Reverse Linked List, Node Swap, Remove Duplicates
  • Move Tail to Head, Merge two Sorted signly Linked Lists

Doubly:

  • Insertion, Deletion, Append and Prepend Doubly Linked List
  • Pairs with Sum, Remove Duplicates, Reverse Doubly Linked List

Circular Linked Lists:

  • Insertion, Deletion, Split list, and Josephus Problem using Circular Linked Lists

Trees

inserting an Image

Tree Data Structure

Includes:

  1. General Tree
  2. Binary Tree
  3. Binary Search Tree
  • AVL Tree, Red-Black Tree, Splay Tree, Treap, B -Tree

Heaps

inserting an Image

  • Special Tree-Based data structure
  • Usually represented as an Array

Heap Data Structure

Two Types of Heaps

  1. Min Heap
  2. Max Heap

Different Applications of Heaps:

  1. Heap Sort - One of the best sorting algorithms!
  2. Priority Queues
  3. Graph Algorithms

Maps and Hash Tables

inserting an Image

Hash Tables

  • Hash Tables

  • Includes Hash Project (in progress)

Graphs

inserting an Image

Introduction to Graphs

  • Properties of Graphs

    • Self-Loop, Multi-Edges, Walk, Path, Trail
    • Connected and Strongly Connected Graphs, Closed Walk, Cycle, Acyclic Graph
  • Graph Representation

    • List and Matrix Representation
  • Graph Traversals
    • Depth First Search and Breadth First Search
  • Topological Sort

  • Shortest Path
    • Djikstra’s Algorithm and Warshall’s Algorithm
  • Minimum Spanning Tree (MST)

  • Includes Graph Project

Dynamic Programming

  • Greedy Algorithm

  • Includes Dynamic Programming Project

Extra

Iterators and Generators in Python