http://www.geeksforgeeks.org/find-the-minimum-distance-between-two-numbers/ #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <stack> #include <string> #include <fstream> #includ…
http://www.geeksforgeeks.org/find-the-missing-number/ 1. use sum formula, O(n), O(1) 2. use XOR, O(n), O(1) 3. use counting sort, O(n), O(1), changing the array 4. use negtive, O(n), O(1), chaning the array #include <iostream> #include <vector>…
http://www.geeksforgeeks.org/move-zeroes-end-array/ #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <stack> #include <string> #include <fstream> #include <map> #include &…
http://www.geeksforgeeks.org/find-if-there-is-a-subarray-with-0-sum/ #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <stack> #include <string> #include <fstream> #include <m…
http://www.geeksforgeeks.org/given-an-array-of-of-size-n-finds-all-the-elements-that-appear-more-than-nk-times/ 这一题如果没空间要求就没那么麻烦了 #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <stack> #i…
http://www.geeksforgeeks.org/sort-elements-by-frequency-set-2/ #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <stack> #include <string> #include <fstream> #include <map>…
http://www.geeksforgeeks.org/maximum-contiguous-circular-sum/ #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <stack> #include <string> #include <fstream> #include <map>…
http://www.geeksforgeeks.org/largest-subarray-with-equal-number-of-0s-and-1s/ #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <stack> #include <string> #include <fstream> #incl…
http://www.geeksforgeeks.org/find-the-two-numbers-with-odd-occurences-in-an-unsorted-array/ #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <stack> #include <string> #include <fst…
http://www.geeksforgeeks.org/longest-monotonically-increasing-subsequence-size-n-log-n/ #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <stack> #include <string> #include <fstream…