Algorithm

Algorithm is most interesting part in computer science. It measure a person how smart and how deep in learning computer science.

I concluded some parts or categories of algorithm questions, but all of these are intertwined together. In one algorithm question, it can combine multiple knowledge points with several categories.

As I know, the algorithm should contains two things. The data, which is the source of information, is the stuff what the algorithm manipulates; Another is strategy, the core of algorithm, which is the thinking, the soul. Here I mainly focus on concludes the strategy that commonly used in algorithm interview questions.

Strategy - Thinking in Algorithms

1. Pointers

Base on Data Structure

  • In Array
    • Interleaving
    • Partition
    • Squeeze Rule
    • with Binary Search
  • In String
    • Palindrome
    • Sub-string Windows
  • In Linked List
    • Walker and Runner Node
    • Dummy Node

Base on Purpose

  • Remove Duplicate
  • Make Partition
  • Do swap
  • Find element

Sort

  • Selection Sort
  • Insertion Sort
  • Bubble Sort
  • Merge Sort
  • Quick Sort
  • Count Sort
  • Radix Sort
  • Binary Search
  • Ternary Search
  • Breath First Search
  • Depth First Search
  • Union Find

3. From Recrusion to Dynamic Programming

Recursion

Divide and Conquer

  • In array
  • In tree
  • In linked list

Backtracking

  • Combination
  • Permutation
  • N Queen

Dynamic Programming

  • Matrix DP
  • One Sequence DP
  • Two Sequence DP
  • Backpack

4. Computer Science cannot live without Math

Math

  • Greatest Common Division
  • Least Common Multiple
  • Elementary Arithmetic Operation with Bitwise Idea
  • Binary, octonary and tenary
  • Power and square root (Divide and Conquer)

Bitwise Manipulation

  • OR's Magic
  • Left or Right Shifting

5. Big Data

Top K Problem

  • Kth largest / smallest element in dataset
  • Find median in data stream
  • Top K frequent element

Cache Algorithm

  • Least Recently Used
  • Least Frequently Used

Bit Set

External Sort

Bloom Fliter

results matching ""

    No results matching ""