You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.markdown
+50-50Lines changed: 50 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -34,31 +34,31 @@ If you're new to algorithms and data structures, here are a few good ones to sta
34
34
35
35
-[Stack](Stack/)
36
36
-[Queue](Queue/)
37
-
-[Insertion Sort](Insertion Sort/)
38
-
-[Binary Search](Binary Search/) and [Binary Search Tree](Binary Search Tree/)
39
-
-[Merge Sort](Merge Sort/)
37
+
-[Insertion Sort](Insertion%20Sort/)
38
+
-[Binary Search](Binary%20Search/) and [Binary Search Tree](Binary%20Search%20Tree/)
39
+
-[Merge Sort](Merge%20Sort/)
40
40
-[Boyer-Moore string search](Boyer-Moore/)
41
41
42
42
## The algorithms
43
43
44
44
### Searching
45
45
46
-
-[Linear Search](Linear Search/). Find an element in an array.
47
-
-[Binary Search](Binary Search/). Quickly find elements in a sorted array.
48
-
-[Count Occurrences](Count Occurrences/). Count how often a value appears in an array.
49
-
-[Select Minimum / Maximum](Select Minimum Maximum). Find the minimum/maximum value in an array.
50
-
-[k-th Largest Element](Kth Largest Element/). Find the *k*-th largest element in an array, such as the median.
51
-
-[Selection Sampling](Selection Sampling/). Randomly choose a bunch of items from a collection.
46
+
-[Linear Search](Linear%20Search/). Find an element in an array.
47
+
-[Binary Search](Binary%20Search/). Quickly find elements in a sorted array.
48
+
-[Count Occurrences](Count%20Occurrences/). Count how often a value appears in an array.
49
+
-[Select Minimum / Maximum](Select%20Minimum%20Maximum). Find the minimum/maximum value in an array.
50
+
-[k-th Largest Element](Kth%20Largest%20Element/). Find the *k*-th largest element in an array, such as the median.
51
+
-[Selection Sampling](Selection%20Sampling/). Randomly choose a bunch of items from a collection.
52
52
-[Union-Find](Union-Find/). Keeps track of disjoint sets and lets you quickly merge them.
53
53
54
54
55
55
### String Search
56
56
57
-
-[Brute-Force String Search](Brute-Force String Search/). A naive method.
57
+
-[Brute-Force String Search](Brute-Force%20String%20Search/). A naive method.
58
58
-[Boyer-Moore](Boyer-Moore/). A fast method to search for substrings. It skips ahead based on a look-up table, to avoid looking at every character in the text.
59
59
- Knuth-Morris-Pratt
60
60
-[Rabin-Karp](Rabin-Karp/) Faster search by using hashing.
61
-
-[Longest Common Subsequence](Longest Common Subsequence/). Find the longest sequence of characters that appear in the same order in both strings.
61
+
-[Longest Common Subsequence](Longest%20Common%20Subsequence/). Find the longest sequence of characters that appear in the same order in both strings.
62
62
-[Z-Algorithm](Z-Algorithm/). Finds all instances of a pattern in a String, and returns the indexes of where the pattern starts within the String.
63
63
64
64
### Sorting
@@ -67,51 +67,51 @@ It's fun to see how sorting algorithms work, but in practice you'll almost never
67
67
68
68
Basic sorts:
69
69
70
-
-[Insertion Sort](Insertion Sort/)
71
-
-[Selection Sort](Selection Sort/)
72
-
-[Shell Sort](Shell Sort/)
70
+
-[Insertion Sort](Insertion%20Sort/)
71
+
-[Selection Sort](Selection%20Sort/)
72
+
-[Shell Sort](Shell%20Sort/)
73
73
74
74
Fast sorts:
75
75
76
76
-[Quicksort](Quicksort/)
77
-
-[Merge Sort](Merge Sort/)
78
-
-[Heap Sort](Heap Sort/)
77
+
-[Merge Sort](Merge%20Sort/)
78
+
-[Heap Sort](Heap%20Sort/)
79
79
80
80
Special-purpose sorts:
81
81
82
-
-[Counting Sort](Counting Sort/)
83
-
-[Radix Sort](Radix Sort/)
84
-
-[Topological Sort](Topological Sort/)
82
+
-[Counting Sort](Counting%20Sort/)
83
+
-[Radix Sort](Radix%20Sort/)
84
+
-[Topological Sort](Topological%20Sort/)
85
85
86
86
Bad sorting algorithms (don't use these!):
87
87
88
-
-[Bubble Sort](Bubble Sort/)
89
-
-[Slow Sort](Slow Sort/)
88
+
-[Bubble Sort](Bubble%20Sort/)
89
+
-[Slow Sort](Slow%20Sort/)
90
90
91
91
### Compression
92
92
93
-
-[Run-Length Encoding (RLE)](Run-Length Encoding/). Store repeated values as a single byte and a count.
94
-
-[Huffman Coding](Huffman Coding/). Store more common elements using a smaller number of bits.
93
+
-[Run-Length Encoding (RLE)](Run-Length%20Encoding/). Store repeated values as a single byte and a count.
94
+
-[Huffman Coding](Huffman%20Coding/). Store more common elements using a smaller number of bits.
95
95
96
96
### Miscellaneous
97
97
98
98
-[Shuffle](Shuffle/). Randomly rearranges the contents of an array.
99
-
-[Comb Sort](Comb Sort/). An improve upon the Bubble Sort algorithm.
99
+
-[Comb Sort](Comb%20Sort/). An improve upon the Bubble Sort algorithm.
100
100
101
101
### Mathematics
102
102
103
103
-[Greatest Common Divisor (GCD)](GCD/). Special bonus: the least common multiple.
104
104
-[Permutations and Combinations](Combinatorics/). Get your combinatorics on!
105
-
-[Shunting Yard Algorithm](Shunting Yard/). Convert infix expressions to postfix.
105
+
-[Shunting Yard Algorithm](Shunting%20Yard/). Convert infix expressions to postfix.
106
106
- Statistics
107
-
-[Karatsuba Multiplication](Karatsuba Multiplication/). Another take on elementary multiplication.
107
+
-[Karatsuba Multiplication](Karatsuba%20Multiplication/). Another take on elementary multiplication.
108
108
-[Haversine Distance](HaversineDistance/). Calculating the distance between 2 points from a sphere.
109
109
110
110
### Machine learning
111
111
112
112
-[k-Means Clustering](K-Means/). Unsupervised classifier that partitions data into *k* clusters.
113
113
- k-Nearest Neighbors
114
-
-[Linear Regression](Linear Regression/)
114
+
-[Linear Regression](Linear%20Regression/)
115
115
- Logistic Regression
116
116
- Neural Networks
117
117
- PageRank
@@ -129,33 +129,33 @@ Most of the time using just the built-in `Array`, `Dictionary`, and `Set` types
129
129
### Variations on arrays
130
130
131
131
-[Array2D](Array2D/). A two-dimensional array with fixed dimensions. Useful for board games.
132
-
-[Bit Set](Bit Set/). A fixed-size sequence of *n* bits.
133
-
-[Fixed Size Array](Fixed Size Array/). When you know beforehand how large your data will be, it might be more efficient to use an old-fashioned array with a fixed size.
134
-
-[Ordered Array](Ordered Array/). An array that is always sorted.
135
-
-[Rootish Array Stack](Rootish Array Stack/). A space and time efficient variation on Swift arrays.
132
+
-[Bit Set](Bit%20Set/). A fixed-size sequence of *n* bits.
133
+
-[Fixed Size Array](Fixed%20Size%20Array/). When you know beforehand how large your data will be, it might be more efficient to use an old-fashioned array with a fixed size.
134
+
-[Ordered Array](Ordered%20Array/). An array that is always sorted.
135
+
-[Rootish Array Stack](Rootish%20Array%20Stack/). A space and time efficient variation on Swift arrays.
136
136
137
137
### Queues
138
138
139
139
-[Stack](Stack/). Last-in, first-out!
140
140
-[Queue](Queue/). First-in, first-out!
141
141
-[Deque](Deque/). A double-ended queue.
142
-
-[Priority Queue](Priority Queue). A queue where the most important element is always at the front.
143
-
-[Ring Buffer](Ring Buffer/). Also known as a circular buffer. An array of a certain size that conceptually wraps around back to the beginning.
142
+
-[Priority Queue](Priority%20Queue). A queue where the most important element is always at the front.
143
+
-[Ring Buffer](Ring%20Buffer/). Also known as a circular buffer. An array of a certain size that conceptually wraps around back to the beginning.
144
144
145
145
### Lists
146
146
147
-
-[Linked List](Linked List/). A sequence of data items connected through links. Covers both singly and doubly linked lists.
147
+
-[Linked List](Linked%20List/). A sequence of data items connected through links. Covers both singly and doubly linked lists.
148
148
-[Skip-List](Skip-List/). Skip List is a probablistic data-structure with same logarithmic time bound and efficiency as AVL/ or Red-Black tree and provides a clever compromise to efficiently support search and update operations.
149
149
150
150
### Trees
151
151
152
152
-[Tree](Tree/). A general-purpose tree structure.
153
-
-[Binary Tree](Binary Tree/). A tree where each node has at most two children.
154
-
-[Binary Search Tree (BST)](Binary Search Tree/). A binary tree that orders its nodes in a way that allows for fast queries.
153
+
-[Binary Tree](Binary%20Tree/). A tree where each node has at most two children.
154
+
-[Binary Search Tree (BST)](Binary%20Search%20Tree/). A binary tree that orders its nodes in a way that allows for fast queries.
155
155
- Red-Black Tree
156
156
- Splay Tree
157
157
- Threaded Binary Tree
158
-
-[Segment Tree](Segment Tree/). Can quickly compute a function over a portion of an array.
158
+
-[Segment Tree](Segment%20Tree/). Can quickly compute a function over a portion of an array.
159
159
- kd-Tree
160
160
-[Heap](Heap/). A binary tree stored in an array, so it doesn't use pointers. Makes a great priority queue.
161
161
- Fibonacci Heap
@@ -164,33 +164,33 @@ Most of the time using just the built-in `Array`, `Dictionary`, and `Set` types
164
164
165
165
### Hashing
166
166
167
-
-[Hash Table](Hash Table/). Allows you to store and retrieve objects by a key. This is how the dictionary type is usually implemented.
167
+
-[Hash Table](Hash%20Table/). Allows you to store and retrieve objects by a key. This is how the dictionary type is usually implemented.
168
168
- Hash Functions
169
169
170
170
### Sets
171
171
172
-
-[Bloom Filter](Bloom Filter/). A constant-memory data structure that probabilistically tests whether an element is in a set.
173
-
-[Hash Set](Hash Set/). A set implemented using a hash table.
172
+
-[Bloom Filter](Bloom%20Filter/). A constant-memory data structure that probabilistically tests whether an element is in a set.
173
+
-[Hash Set](Hash%20Set/). A set implemented using a hash table.
174
174
- Multiset
175
-
-[Ordered Set](Ordered Set/). A set where the order of items matters.
175
+
-[Ordered Set](Ordered%20Set/). A set where the order of items matters.
A lot of software developer interview questions consist of algorithmic puzzles. Here is a small selection of fun ones. For more puzzles (with answers), see [here](http://elementsofprogramminginterviews.com/) and [here](http://www.crackingthecodinginterview.com).
0 commit comments