Skip to content

mhhg/acm

Repository files navigation

Introduction to Algorithms

The following are the common subjects in coding interviews.

As understanding those concepts requires much more effort, this tutorial only serves as an introduction.

The subjects that are covered include:

  1. String/Array/Matrix
  2. Linked List
  3. Tree
  4. Heap
  5. Graph
  6. Sorting
  7. Dynamic Programming
  8. Bit Manipulation
  9. Combinations and Permutations
  10. Math Problems
  • An algorithm problem contains 3 parts: the input, the output and the solution.

  • The input data structures can be an array, string, tree, liked list, matrix, etc.

  • The algorithm used to solve the problem can be dynamic programming, BFS and DFS.

  • It can also be a data structure, such as a heap, stack, hash set, hash map, etc.

  • The algorithm problems are classified by their input data structure.

  • Under each categories, the problems are tagged with their algorithm or data structure used to solve the problem.

  1. Array/String

    • Two Pointers
      1. Two Sum, Two Sum II, Two Sum III, 3Sum, 4Sum, 3Sum Closest
    • Classic array problem
    • Finding a Number
    • Binary Search
    • Stack
      • Largest Rectangle
      • Nested Object
    • HashMap
      • Tracking
    • HashSet
    • Caching
    • Rotate
    • Bucket Sort
    • DFS
    • BFS
    • Heap
    • TreeSet
    • Track min/max and update result
    • Stream (deque/caching/heap/treeset)
    • Sorting
    • Interval
    • Implement data structure
    • Trie
    • Segment Tree & Binary Index Tree
    • Graph (mainly topological sort)
    • Ugly Number
    • Maximum subarray
    • Word break
    • DP
      • 2D
    • Design data structure with time requirements
    • Other dbf/bfs
    • Random
    • Other
  2. Matrix

    • sorted matrix
    • queue
    • bfs/dfs
  3. Linked List

  4. Tree

    • traveral
    • dfs/bfs
  5. Bit Manipulation

  6. Math

    • power
    • /%
  • These questions are solved using Python 3 and Google Go with unit test.

https://www.programcreek.com/2013/08/leetcode-problem-classification/

https://www.programcreek.com/2012/11/top-10-algorithms-for-coding-interview/