Skip to content

Python implementation of basic data structure and algorithms in Introduction to Algorithms class.

Notifications You must be signed in to change notification settings

gaoisbest/Basic-Algorithms

Repository files navigation

1. Introduction

Python implementation of basic algorithms in Introduction to Algorithms class. Here is the video 1 and video 2.

2. Data structure

3. Algorithm

3.1 Algorithm attributes

  • Finite (有穷性)
  • Determinate (确定性)
  • Feasible (可行性)
  • Input & output

3.2 Algorithm complexity

  • Time
    • Basic operation times
    • O(nlgn)
      • Expectation time of quicksort
      • Lower-bound of comparison-based sorting algorithms
  • Space
    • Memory usage
  • Difference
    • Space can be reused
    • Time and space can be interchanged (e.g. Hash)
  • O(1) < O(lgn) < O(n^(1/2)) < O(n) < O(nlgn) < O(n^2) < O(n^3) < O(2^n) < O(n!)

3.3 Algorithm design technique

4. Lectures

  • Lecture 1: introduction, analysis of algorithms, insertion sort, merge sort.
  • Lecutre 2: asymptotic notation, solving recurrences: substitution, recurrsion tree, master.
  • Lecutre 3: divide and conquer, binary search, merge sort, x to the power of n, matrix multiplication of Fibonacci numbers, Strassen matrix multiplication.
  • Lecutre 4: quick sort, randomized quick sort.
  • Lecutre 5: comparison sorting, decision tree model, sort in linear time: couting sort, radix sort, stable sorting algorithm
  • Lecutre 6: find the k-th element: quick select, worst-case linear-time order statistics
  • Lecutre 7: Hash, hash function, load factor, collision: chaining, open addressing
  • Lecutre 8: universal hashing
  • Lecutre 9: binary search tree, bst sort, Jensen's equality, convex, expected random build bst height is O(lgn)
  • Lecutre 10: red-black tree, rb-insert, rotation
  • Lecutre 11: dynamic order statistics, data structure augmentation, interval tree
  • Lecutre 12: dynamic programming two hallmarks, longest common subsequence
  • Lecutre 13
  • Lecutre 14
  • Lecutre 15
  • Lecutre 16
  • Lecutre 17
  • Lecutre 18
  • Lecutre 19
  • Lecutre 20
  • Lecutre 21
  • Lecutre 22

5. Coding interview Book

  • Codes
  • Chapter 1
    • 1.1 How to test a algorithm?
      • First: it works
      • Second: robust to boundary value or invalid value
      • Third: optimize it by considering time and space complexity
    • 1.2 How to solve a hard problem?
      • First: think it at a whole
      • Second: from n=1, n=2; make an example; visualize it

About

Python implementation of basic data structure and algorithms in Introduction to Algorithms class.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published