back

Algo Techniques

On manipulating arrays

  • Find the base case first

  • Solve for one step, then repeat

  • Start from end N…0

  • Seek from both ends and check if they meet

  • If seeking a match is not intutive, Negate and ignore non-match

  • Treat it as two different arrays: 0…n, n+1…N (tail recursion)

  • Look for details, ie: Sorted arrays

  • If it requires a lot of search, sort it first for binary search