-
Notifications
You must be signed in to change notification settings - Fork 0
/
descriptions.txt
60 lines (38 loc) · 2.69 KB
/
descriptions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
1. Given a Binary Search Tree of numbers, find two nodes that sum to K. bst_2_nodes_sum_to_k.py
2. Device an optimal strategy to win this game: There is an array of numbers from which numbers
can be "taken" from only the two ends. You are playing with an adverserial opponent, and each
player takes a number for himself when he gets his turn. Players take turns one after the other.
The player who takes the maximum sum wins the game. coin_choose_game.py
3. Given a number, determine if it's the sum of two cubes. 1729 == 10^10^10 + 9^9^9. cubes.py
4. Single source, shortest path. dijkstra.py
5. Find edit distance between two strings. edit_distance.py
6. Egg dropping puzzle. Given N eggs, and a K storey building, find the optimal strategy to find
the storey number where the egg breaks. egg_dropping.py
7. Generate columns from Excel. ie. given alphabet (AB), print A, B, AA, AB, BA, BB, AAA, AAB....
excel.py
8. Given a set of documents, print each doc pair followed by how similar they are to each other.
Similarity is defined by the Jaccard coefficient (sim = size(intersection)/size(union))
9. Given an array of strings, find the maximum length prefix shared by more (strict) than half
the elements in the array. find_max_prefix_greater_than_n_by_2.py
10. Find a random node in a binary tree. find_random_node_in_binary_tree.py
11. Given an array, print elements (in the same order as in the original array) that are not
duplicated anywhere in the array. first_non_duplicate_stream.py
12. Heap Sort. heapsort.py
13. Find the longest palindromic subsequence in a string. longest_palindromic_subsequence.py
14. Implement factorial and binary search algorithms recursively without using system stack, but
simulating your own stack. manual_stack_recursions.py
15. Find maxsum subarray (not subsequnce) with K distinct elements.
maxsum_subarray_with_k_distinct_elements.py
16. Merge Sort. mergesort.py
17. Given an array of product prices, find the minimum number of products that can be bought with
a given amount of money. min_number_of_products_for_given_money.py
18. Given 2*N people in a room, how many unique configurations exist in which they are
non-overlapping-shaking-hands? num_nonoverlapping_handshakes.py
19. Quick Sort. quicksort.py
20. Given an array, find the smallest subarray (not subsequence) with given specific elements.
smallest_subarray_with_specific_elements.py
21. Using algorithmic techniques and basic arithmatic, find the approximate square root of a number.
square_root.py
22. Implement topoligical sort. topological_sort.py
23. Given an array of words, and a max column width, wrap the words into a paragraph such that the
sum of the remaining spaces at the end is minimized. word_wrap.py