Module Assign NameStore Str Assign NameStore Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Call NameLoad NameLoad Num Num body For NameStore Call NameLoad NameLoad NameLoad body If CompareEq Call NameLoad NameLoad Call NameLoad NameLoad body Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad If CompareEq NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpMult ListLoad Num Call NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body For NameStore Call NameLoad NameLoad body If CompareLtE SubscriptLoad NameLoad Index NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad BinOpAdd Num SubscriptLoad NameLoad Index NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Num For NameStore Call NameLoad NameLoad body If CompareLtE SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body Assign NameStore Call NameLoad NameLoad BinOpAdd Num Call NameLoad NameLoad Return NameLoad decorator_list NameLoad Return Call NameLoad GeneratorExp Call NameLoad NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Print Call NameLoad NameLoad decorator_list NameLoad Expr NameLoad FunctionDef arguments args defaults body Print Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Print Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args defaults body Print Call NameLoad NameLoad decorator_list NameLoad If CompareEq NameLoad Str body ImportFrom alias Assign NameStore ListComp Call NameLoad Num comprehension NameStore Call NameLoad Num Print NameLoad Expr Call NameLoad Expr Call NameLoad Expr Call NameLoad Expr Call NameLoad
N/A N/A __author__ Mari Wahl N/A __email__ marina.w4hl@gmail.com itertools combinations bisect bisect memo memo do_benchmark benchmark naive_longest_inc_subseq N/A N/A seq N/A N/A N/A  naive (exponential) solution to the longest increasing subsequence problem  N/A length N/A range N/A len seq 0 -1 N/A N/A sub N/A combinations seq length N/A N/A N/A N/A list sub N/A sorted sub N/A N/A N/A len sub N/A longest_inc_subseq1 N/A N/A seq N/A N/A N/A  an iterative algorithm for the longest increasing subsequence problem  N/A end N/A N/A val seq N/A N/A idx N/A bisect end val N/A N/A idx N/A len end N/A N/A N/A N/A end append val N/A N/A N/A end N/A idx val N/A N/A len end N/A longest_inc_subseq2 N/A N/A seq N/A N/A N/A  another iterative algorithm for the longest increasing subsequence problem  N/A L N/A N/A 1 N/A len seq N/A N/A cur val N/A enumerate seq N/A N/A pre N/A range cur N/A N/A N/A N/A seq N/A pre val N/A N/A N/A L N/A cur N/A max N/A L N/A cur N/A 1 N/A L N/A pre N/A N/A max L N/A memoized_longest_inc_subseq N/A N/A seq N/A N/A N/A  a memoized recursive solution to find the longest increasing subsequence problem  L N/A N/A cur N/A N/A N/A res 1 N/A pre N/A range cur N/A N/A N/A N/A seq N/A pre N/A seq N/A cur N/A N/A res N/A max res N/A 1 N/A L pre N/A res N/A memo N/A N/A max N/A N/A L i N/A i N/A range N/A len seq N/A test_naive_longest_inc_subseq N/A N/A N/A N/A N/A N/A naive_longest_inc_subseq s1 N/A benchmark N/A benchmark test_longest_inc_subseq1 N/A N/A N/A N/A N/A N/A longest_inc_subseq1 s1 N/A test_longest_inc_subseq2 N/A N/A N/A N/A N/A N/A longest_inc_subseq2 s1 N/A benchmark test_memoized_longest_inc_subseq N/A N/A N/A N/A N/A N/A memoized_longest_inc_subseq s1 N/A benchmark N/A N/A __name__ __main__ N/A random randrange N/A s1 N/A N/A randrange 100 N/A i N/A range 25 N/A s1 N/A N/A test_naive_longest_inc_subseq N/A N/A test_longest_inc_subseq1 N/A N/A test_longest_inc_subseq2 N/A N/A test_memoized_longest_inc_subseq