Last active
August 29, 2015 14:20
-
-
Save dapangmao/1ca3c2983e7a0ea1f48d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://code2flow.com | |
A Q is raised; | |
Name of the function; | |
Input type and output type; | |
Test case; | |
Contrains / time / space requirements; | |
if (Q in [Leetcode, CareerCup] or similiar) | |
{ | |
Recall the answer; | |
prepare the followup | |
} | |
else { | |
if (Q has hints) | |
{ | |
if (sorted) | |
{ | |
binary search | |
} | |
else if ( max or all) | |
{ | |
dp or backtracking | |
} | |
else if ( bit / tree / linked list ) | |
{ | |
common strategies | |
} | |
else | |
{ | |
data structure brainstorm | |
hash / stack / heap | |
} | |
} | |
else | |
{ | |
estimate the difficulty; | |
ask for hints | |
} | |
} | |
Start to write codes; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment