JIAZHEN / structure-algorithm

Implement data structure and algorithm in ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Knowledge about data structure and algorithms

Big O notation

Big O notation is used in Computer Science to describe the performance or complexity of an algorithm.

  • O(1): describes an algorithm that will always execute in the same time (or space) regardless of the size of the input data set.
  • O(N): describes an algorithm whose performance will grow linearly and in direct proportion to the size of the input data set.
  • O(N**2): represents an algorithm whose performance is directly proportional to the square of the size of the input data set.
  • O(2**N): denotes an algorithm whose growth doubles with each additon to the input data set.
  • O(log N): The iterative halving of data sets described in the binary search example produces a growth curve that peaks at the beginning and slowly flattens out as the size of the data sets increase

The summary image of each Big O

big-o-summary

Cheat sheet

List of the things

  • Sorting

  • Stacks and Queue

  • Divisibility Operations and Primes

  • Tree

  • Graph

    • Depth-first search
    • Breadth-first search
    • Topological sort
  • Algorithm Design

    • Greedy Programming Concepts
    • Dynamic Programming Concepts
    • Divide-and-Conquer Concepts

About

Implement data structure and algorithm in ruby

License:MIT License


Languages

Language:Ruby 100.0%