Skip to content

Instantly share code, notes, and snippets.

View magic003's full-sized avatar

Minjie Zha magic003

  • Bay Area, United States
View GitHub Profile
@magic003
magic003 / Algorithm Tips.md
Last active December 30, 2015 18:09
This gist lists the things important for preparing a technical interview.
  • Consider using HashMap when comparing two strings or arrays.
  • When handling string problems, ask if it is ASCII. Use an array of length 256 if it is.
  • When comparing two strings or arrays, sort them first.
  • Using StringBuffer for the temporary result for string concatenate.
  • Prepend a dummy node for linked list problems.
  • Remember integer might be negative!
  • Computer cannot accurately represent float/double, use epsilon for equality check.

Common tricks:

  • Interval intersection: 1) sort by start point, binary search the end point 2) sort both start and end points, go through the array, for start point i++, for end point i--.
@magic003
magic003 / cheatsheet.md
Last active April 5, 2016 05:43
Vim Cheat Sheet

Vim Cheat Sheet

Navigation

* Search the current word