diff --git "a/001._clone\346\234\200\346\226\260" "b/001._clone\346\234\200\346\226\260" deleted file mode 100644 index 22063ae2ca5deb67b9a021ac78fb0b6556c4f95c..0000000000000000000000000000000000000000 --- "a/001._clone\346\234\200\346\226\260" +++ /dev/null @@ -1 +0,0 @@ -001._记得先clone最新. diff --git a/Readme.md b/Readme.md index ea453be995986beaa048a4a113f83d8db2645680..9fafaced9e477eb1d96e1efe8fbf96fba051cbc9 100644 --- a/Readme.md +++ b/Readme.md @@ -1,32 +1,313 @@ -### Reference and Appreciation: +# LeetCode 面试题 -1. [KrisYu的GItuhub](https://github.com/KrisYu/LeetCode-CLRS-Python) +## [八大算法算](/docs/SortingAlgorithm/README.md) -2. [kamyu104的Github](https://github.com/kamyu104/LeetCode) +![](/images/SortingAlgorithm/八大排序算法性能.png) -3. [数据结构与算法/leetcode/lintcode题解](https://algorithm.yuanbin.me/zh-hans/) +| 名称 | 文档 | 代码 | +| --- | --- | --- | +| 冒泡排序 | ![](/images/SortingAlgorithm/冒泡排序.gif) | [BubbleSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/BubbleSort.py) | +| 插入排序 | ![](/images/SortingAlgorithm/直接插入排序.gif) | [InsertSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/InsertSort.py) | +| 选择排序 | ![](/images/SortingAlgorithm/简单选择排序.gif) | [SelectionSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/SelectionSort.py) | +| 快速排序 | ![](/images/SortingAlgorithm/快速排序.gif) | [QuickSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/QuickSort.py) | +| 希尔排序 | ![](/images/SortingAlgorithm/希尔排序.png) | [ShellSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/ShellSort.py) | +| 归并排序 | ![](/images/SortingAlgorithm/归并排序.gif) | [MergeSort.py](/opt/git/LeetCode/docs/src/py2.x/SortingAlgorithm/MergeSort.py) | +| 基数排序 | ![](/images/SortingAlgorithm/基数排序.gif) | | -4. [Leetcode 讨论区](https://discuss.leetcode.com/) +## 面试问答 -5. [visualgo算法可视化网站](https://visualgo.net/en) +* [Google面试题](/docs/interview/Google/Google.md) +* [pocketgems 面试题](/docs/interview/pocketgems/pocketgems.md) +* [WePay 面试题](/docs/interview/WePay/WePay.md) -6. [Data Structure Visualization](https://www.cs.usfca.edu/~galles/visualization/Algorithms.html) +## LeetCode算法题 -7. [我的算法学习之路 - Lucida](http://zh.lucida.me/blog/on-learning-algorithms/) +* [](docs/LeetCode/001._two_sum.md) +* [](/docs/LeetCode/002._add_two_numbers.md) +* [](/docs/LeetCode/003._longest_substring_without_repeating_characters.md) +* [](/docs/LeetCode/004._median_of_two_sorted_arrays.md) +* [](/docs/LeetCode/005._longest_palindromic_substring.md) +* [](/docs/LeetCode/007._Reverse_Integer.md) +* [](/docs/LeetCode/008._string_to_integer_(atoi).md) +* [](/docs/LeetCode/010._regular_expression_matching.md) +* [](/docs/LeetCode/011._container_with_most_water.md) +* [](/docs/LeetCode/012._Integer_to_Roman.md) +* [](/docs/LeetCode/013._Roman_to_Integer.md) +* [](/docs/LeetCode/014._longest_common_prefix.md) +* [](/docs/LeetCode/015._3sum.md) +* [](/docs/LeetCode/016._3sum_closest.md) +* [](/docs/LeetCode/017._letter_combinations_of_a_phone_number.md) +* [](/docs/LeetCode/018._4sum.md) +* [](/docs/LeetCode/019._remove_nth_node_from_end_of_list.md) +* [](/docs/LeetCode/020._valid_parentheses.md) +* [](/docs/LeetCode/021._merge_two_sorted_lists.md) +* [](/docs/LeetCode/022._generate_parentheses.md) +* [](/docs/LeetCode/023._merge_k_sorted_lists.md) +* [](/docs/LeetCode/024._swap_nodes_in_pairs.md) +* [](/docs/LeetCode/026._Remove_Duplicates_from_Sorted_Array.md) +* [](/docs/LeetCode/027._Remove_Element.md) +* [](/docs/LeetCode/028._implement_strstr().md) +* [](/docs/LeetCode/030._Substring_with_Concatenation_of_All_Words.md) +* [](/docs/LeetCode/031._next_permutation.md) +* [](/docs/LeetCode/033._search_in_rotated_sorted_array.md) +* [](/docs/LeetCode/034._SearchforaRange.md) +* [](/docs/LeetCode/035._search_insert_position.md) +* [](/docs/LeetCode/038._Count_and_Say.md) +* [](/docs/LeetCode/039._combination_sum.md) +* [](/docs/LeetCode/040._combination_sum_ii.md) +* [](/docs/LeetCode/042._trapping_rain_water.md) +* [](/docs/LeetCode/043._multiply_strings.md) +* [](/docs/LeetCode/044._wildcard_matching.md) +* [](/docs/LeetCode/045._Jump_Game_II.md) +* [](/docs/LeetCode/046._permutations.md) +* [](/docs/LeetCode/047._permutations_ii.md) +* [](/docs/LeetCode/048._rotate_image.md) +* [](/docs/LeetCode/049._group_anagrams_python.md) +* [](/docs/LeetCode/050._pow(x,_n).md) +* [](/docs/LeetCode/051._n-queens.md) +* [](/docs/LeetCode/052._n-queens_ii.md) +* [](/docs/LeetCode/053._maximum_subarray.md) +* [](/docs/LeetCode/054._spiral_matrix.md) +* [](/docs/LeetCode/055._jump_game.md) +* [](/docs/LeetCode/056._Merge_Intervals.md) +* [](/docs/LeetCode/058._length_of_last_word.md) +* [](/docs/LeetCode/059._spiral_matrix_ii.md) +* [](/docs/LeetCode/060._permutation_sequence.md) +* [](/docs/LeetCode/061._rotate_list.md) +* [](/docs/LeetCode/064._minimum_path_sum.md) +* [](/docs/LeetCode/065.unique_paths_ii.md) +* [](/docs/LeetCode/066._plus_one.md) +* [](/docs/LeetCode/067._add_binary.md) +* [](/docs/LeetCode/069._sqrt(x).md) +* [](/docs/LeetCode/070.ClimbingStairs.md) +* [](/docs/LeetCode/072._edit_distance.md) +* [](/docs/LeetCode/073.SetMatrixZeroes.md) +* [](/docs/LeetCode/074._search_a_2d_matrix.md) +* [](/docs/LeetCode/075._sort_colors.md) +* [](/docs/LeetCode/076._Minimum_Window_Substring.md) +* [](/docs/LeetCode/077._combinations.md) +* [](/docs/LeetCode/078.Subsets.md) +* [](/docs/LeetCode/079._word_search.md) +* [](/docs/LeetCode/082._remove_duplicates_from_sorted_list_ii.md) +* [](/docs/LeetCode/083._remove_duplicates_from_sorted_list.md) +* [](/docs/LeetCode/086._partition_list.md) +* [](/docs/LeetCode/088._merge_sorted_array.md) +* [](/docs/LeetCode/089._gray_code.md) +* [](/docs/LeetCode/090._subsets_ii.md) +* [](/docs/LeetCode/091._decode_ways.md) +* [](/docs/LeetCode/092._reverse_linked_list_ii.md) +* [](/docs/LeetCode/093._restore_ip_addresses.md) +* [](/docs/LeetCode/094._binary_tree_inorder_traversal.md) +* [](/docs/LeetCode/096._unique_binary_search_trees.md) +* [](/docs/LeetCode/098._validate_binary_search_tree.md) +* [](/docs/LeetCode/100._same_tree.md) +* [](/docs/LeetCode/101._symmetric_tree.md) +* [](/docs/LeetCode/102._binary_tree_level_order_traversal.md) +* [](/docs/LeetCode/103._binary_tree_zigzag_level_order_traversal.md) +* [](/docs/LeetCode/104._maximum_depth_of_binary_tree.md) +* [](/docs/LeetCode/105._construct_binary_tree_from_preorder_and_inorder_traversal.md) +* [](/docs/LeetCode/106._construct_binary_tree_from_inorder_and_postorder_traversal.md) +* [](/docs/LeetCode/107._binary_tree_level_order_traversal_ii.md) +* [](/docs/LeetCode/108._convert_sorted_array_to_binary_search_tree.md) +* [](/docs/LeetCode/109._convert_sorted_list_to_binary_search_tree.md) +* [](/docs/LeetCode/110._balanced_binary_tree.md) +* [](/docs/LeetCode/111._minimum_depth_of_binary_tree.md) +* [](/docs/LeetCode/112._path_sum.md) +* [](/docs/LeetCode/113._path_sum_ii.md) +* [](/docs/LeetCode/114._flatten_binary_tree_to_linked_list.md) +* [](/docs/LeetCode/116._populating_next_right_pointers_in_each_node.md) +* [](/docs/LeetCode/118._pascal's_triangle.md) +* [](/docs/LeetCode/119.Pascal'sTriangleII.md) +* [](/docs/LeetCode/120.Triangle.md) +* [](/docs/LeetCode/121._Best_Time_to_Buy_and_Sell_Stock.md) +* [](/docs/LeetCode/125._valid_palindrome.md) +* [](/docs/LeetCode/126.WordLadderII.md) +* [](/docs/LeetCode/127._word_ladder.md) +* [](/docs/LeetCode/128._Longest_Consecutive_Sequence.md) +* [](/docs/LeetCode/129._sum_root_to_leaf_numbers.md) +* [](/docs/LeetCode/130._surrounded_regions.md) +* [](/docs/LeetCode/131._palindrome_partitioning.md) +* [](/docs/LeetCode/133._clone_graph.md) +* [](/docs/LeetCode/136._single_number.md) +* [](/docs/LeetCode/139._word_break.md) +* [](/docs/LeetCode/140._word_break_ii.md) +* [](/docs/LeetCode/141._linked_list_cycle.md) +* [](/docs/LeetCode/142_Linked_List_Cycle_II.md) +* [](/docs/LeetCode/143._reorder_list.md) +* [](/docs/LeetCode/144._binary_tree_preorder_traversal.md) +* [](/docs/LeetCode/145._binary_tree_postorder_traversal.md) +* [](/docs/LeetCode/147._insertion_sort_list.md) +* [](/docs/LeetCode/148._sort_list.md) +* [](/docs/LeetCode/150._evaluate_reverse_polish_notation.md) +* [](/docs/LeetCode/151._reverse_words_in_a_string.md) +* [](/docs/LeetCode/152._maximum_product_subarray.md) +* [](/docs/LeetCode/153._find_minimum_in_rotated_sorted_array.md) +* [](/docs/LeetCode/155._min_stack.md) +* [](/docs/LeetCode/159._Longest_Substring_with_At_Most_Two_Distinct_Characters.md) +* [](/docs/LeetCode/160._intersection_of_two_linked_lists.md) +* [](/docs/LeetCode/162._find_peak_element.md) +* [](/docs/LeetCode/165._compare_version_numbers.md) +* [](/docs/LeetCode/166._Fraction_to_Recurring_Decimal.md) +* [](/docs/LeetCode/167._two_sum_ii_-_input_array_is_sorted.md) +* [](/docs/LeetCode/168._excel_sheet_column_title.md) +* [](/docs/LeetCode/169._majority_element.md) +* [](/docs/LeetCode/171._excel_sheet_column_number.md) +* [](/docs/LeetCode/173._binary_search_tree_iterator.md) +* [](/docs/LeetCode/189._rotate_array.md) +* [](/docs/LeetCode/191._number_of_1_bits.md) +* [](/docs/LeetCode/198._house_robber.md) +* [](/docs/LeetCode/199._binary_tree_right_side_view.md) +* [](/docs/LeetCode/200._number_of_islands.md) +* [](/docs/LeetCode/203._remove_linked_list_elements.md) +* [](/docs/LeetCode/204._count_primes.md) +* [](/docs/LeetCode/205._isomorphic_strings.md) +* [](/docs/LeetCode/206._reverse_linked_list.md) +* [](/docs/LeetCode/207._course_schedule.md) +* [](/docs/LeetCode/208._implement_trie_(prefix_tree).md) +* [](/docs/LeetCode/210._course_schedule_ii.md) +* [](/docs/LeetCode/211.AddandSearchWord-Datastructuredesign.md) +* [](/docs/LeetCode/213._house_robber_ii.md) +* [](/docs/LeetCode/216._combination_sum_iii.md) +* [](/docs/LeetCode/217._contains_duplicate.md) +* [](/docs/LeetCode/218._The_Skyline_Problem.md) +* [](/docs/LeetCode/219._contains_duplicate_ii.md) +* [](/docs/LeetCode/221._maximal_square.md) +* [](/docs/LeetCode/222._count_complete_tree_nodes.md) +* [](/docs/LeetCode/223._rectangle_area.md) +* [](/docs/LeetCode/224.BasicCalculator.md) +* [](/docs/LeetCode/225._implement_stack_using_queues.md) +* [](/docs/LeetCode/226._invert_binary_tree.md) +* [](/docs/LeetCode/227._basic_calculator_ii.md) +* [](/docs/LeetCode/228._summary_ranges.md) +* [](/docs/LeetCode/229._majority_element_ii.md) +* [](/docs/LeetCode/230._kth_smallest_element_in_a_bst.md) +* [](/docs/LeetCode/231._Power_of_Two.md) +* [](/docs/LeetCode/232._implement_queue_using_stacks.md) +* [](/docs/LeetCode/234._palindrome_linked_list.md) +* [](/docs/LeetCode/235._lowest_common_ancestor_of_a_binary_search_tree.md) +* [](/docs/LeetCode/236._lowest_common_ancestor_of_a_binary_tree.md) +* [](/docs/LeetCode/237._delete_node_in_a_linked_list.md) +* [](/docs/LeetCode/238._product_of_array_except_self.md) +* [](/docs/LeetCode/240._search_a_2d_matrix_ii.md) +* [](/docs/LeetCode/242._valid_anagram.md) +* [](/docs/LeetCode/252.MeetingRooms.md) +* [](/docs/LeetCode/255._Verify_Preorder_Sequence_in_Binary_Search_Tree.md) +* [](/docs/LeetCode/256.PaintHouse.md) +* [](/docs/LeetCode/257._binary_tree_paths.md) +* [](/docs/LeetCode/258_Add_Digits.md) +* [](/docs/LeetCode/261.GraphValidTree.md) +* [](/docs/LeetCode/263._ugly_number.md) +* [](/docs/LeetCode/264._ugly_number_ii.md) +* [](/docs/LeetCode/265.PaintHouseII.md) +* [](/docs/LeetCode/266.PalindromePermutation.md) +* [](/docs/LeetCode/267.PalindromePermutationII.md) +* [](/docs/LeetCode/268._missing_number.md) +* [](/docs/LeetCode/270.ClosestBinarySearchTreeValue.md) +* [](/docs/LeetCode/276.PaintFence.md) +* [](/docs/LeetCode/277.FindtheCelebrity.md) +* [](/docs/LeetCode/278._First_Bad_Version.md) +* [](/docs/LeetCode/279._perfect_squares.md) +* [](/docs/LeetCode/280._Wiggle_Sort.md) +* [](/docs/LeetCode/283._move_zeroes.md) +* [](/docs/LeetCode/285._inorder_successor_in_bst.md) +* [](/docs/LeetCode/286.WallsandGates.md) +* [](/docs/LeetCode/289._game_of_life.md) +* [](/docs/LeetCode/290._word_pattern.md) +* [](/docs/LeetCode/292._nim_game.md) +* [](/docs/LeetCode/296.BestMeetingPoint.md) +* [](/docs/LeetCode/298.BinaryTreeLongestConsecutiveSequence.md) +* [](/docs/LeetCode/299._bulls_and_cows.md) +* [](/docs/LeetCode/300._longest_increasing_subsequence.md) +* [](/docs/LeetCode/303._range_sum_query_-_immutable.md) +* [](/docs/LeetCode/316._Remove_Duplicate_Letters.md) +* [](/docs/LeetCode/319._Bulb_Switcher.md) +* [](/docs/LeetCode/322.CoinChange.md) +* [](/docs/LeetCode/323.NumberofConnectedComponentsinanUndirectedGraph.md) +* [](/docs/LeetCode/324._Wiggle_Sort_II.md) +* [](/docs/LeetCode/326._power_of_three.md) +* [](/docs/LeetCode/328._odd_even_linked_list.md) +* [](/docs/LeetCode/334._increasing_triplet_subsequence.md) +* [](/docs/LeetCode/337._house_robber_iii.md) +* [](/docs/LeetCode/338.CountingBits.md) +* [](/docs/LeetCode/339.NestedListWeightSum.md) +* [](/docs/LeetCode/341._Flatten_Nested_List_Iterator.md) +* [](/docs/LeetCode/342._Power_of_Four.md) +* [](/docs/LeetCode/344._reverse_string.md) +* [](/docs/LeetCode/345._Reverse_Vowels_of_a_String.md) +* [](/docs/LeetCode/349._intersection_of_two_arrays.md) +* [](/docs/LeetCode/350._intersection_of_two_arrays_ii.md) +* [](/docs/LeetCode/353.DesignSnakeGame.md) +* [](/docs/LeetCode/364.NestedListWeightSumII.md) +* [](/docs/LeetCode/366.FindLeavesofBinaryTree.md) +* [](/docs/LeetCode/367._valid_perfect_square.md) +* [](/docs/LeetCode/369.PlusOneLinkedList.md) +* [](/docs/LeetCode/371._sum_of_two_integers.md) +* [](/docs/LeetCode/374._Guess_Number_Higher_or_Lower.md) +* [](/docs/LeetCode/377._combination_sum_iv.md) +* [](/docs/LeetCode/378._kth_smallest_element_in_a_sorted_matrix.md) +* [](/docs/LeetCode/380.InsertDeleteGetRandomO(1).md) +* [](/docs/LeetCode/381.InsertDeleteGetRandomO(1)-Duplicatesallowed.md) +* [](/docs/LeetCode/382._linked_list_random_node.md) +* [](/docs/LeetCode/383._ransom_note.md) +* [](/docs/LeetCode/384.ShuffleanArray.md) +* [](/docs/LeetCode/387._first_unique_character_in_a_string.md) +* [](/docs/LeetCode/388._Longest_Absolute_File_Path.md) +* [](/docs/LeetCode/389._find_the_difference.md) +* [](/docs/LeetCode/392._is_subsequence.md) +* [](/docs/LeetCode/394._decode_string.md) +* [](/docs/LeetCode/400.NthDigit.md) +* [](/docs/LeetCode/401._binary_watch.md) +* [](/docs/LeetCode/404._sum_of_left_leaves.md) +* [](/docs/LeetCode/405.ConvertaNumbertoHexadecimal.md) +* [](/docs/LeetCode/406._Queue_Reconstruction_by_Height.md) +* [](/docs/LeetCode/412._fizz_buzz.md) +* [](/docs/LeetCode/413.ArithmeticSlices.md) +* [](/docs/LeetCode/414._third_maximum_number.md) +* [](/docs/LeetCode/415._add_strings.md) +* [](/docs/LeetCode/416.PartitionEqualSubsetSum.md) +* [](/docs/LeetCode/421._Maximum_XOR_of_Two_Numbers_in_an_Array.md) +* [](/docs/LeetCode/422.ValidWordSquare.md) +* [](/docs/LeetCode/434._number_of_segments_in_a_string.md) +* [](/docs/LeetCode/437._path_sum_iii.md) +* [](/docs/LeetCode/438._Find_All_Anagrams_in_a_String.md) +* [](/docs/LeetCode/439.TernaryExpressionParser.md) +* [](/docs/LeetCode/441._arranging_coins.md) +* [](/docs/LeetCode/448._Find_All_Numbers_Disappeared_in_an_Array.md) +* [](/docs/LeetCode/450.DeleteNodeinaBST.md) +* [](/docs/LeetCode/453._Minimum_Moves_to_Equal_Array_Elements.md) +* [](/docs/LeetCode/459._Repeated_Substring_Pattern.md) +* [](/docs/LeetCode/461._HammingDistance.md) +* [](/docs/LeetCode/463._Island_Perimeter.md) +* [](/docs/LeetCode/467._Unique_Substrings_in_Wraparound_String.md) +* [](/docs/LeetCode/469.ConvexPolygon.md) +* [](/docs/LeetCode/476._Number_Complement.md) +* [](/docs/LeetCode/477._Total_Hamming_Distance.md) +* [](/docs/LeetCode/485._Max_Consecutive_Ones.md) +* [](/docs/LeetCode/587._Erect_the_Fence.md) +* [](/docs/LeetCode/599._Minimum_Index_Sum_of_Two_Lists.md) +* [](/docs/LeetCode/647._Palindromic_Substrings.md) +* [](/docs/LeetCode/657._Judge_Route_Circle.md) +* [](/docs/LeetCode/665._Non-decreasing_Array.md) +* [](/docs/LeetCode/672._Bulb_Switcher_II.md) +* [](/docs/LeetCode/681._Next_Closest_Time.md) +* [](/docs/LeetCode/682._Baseball_Game.md) +* [](/docs/LeetCode/687._Longest_Univalue_Path.md) +* [](/docs/LeetCode/740._delete_and_earn.md) +* [](/docs/LeetCode/760._Find_Anagram_Mappings.md) -8. [HiredInTech](https://www.hiredintech.com/) System Design 的总结特别适合入门 +## 推荐的一些LeetCode网站 +1. [KrisYu的GItuhub](https://github.com/KrisYu/LeetCode-CLRS-Python) +2. [kamyu104的Github](https://github.com/kamyu104/LeetCode) +3. [数据结构与算法/leetcode/lintcode题解](https://algorithm.yuanbin.me/zh-hans/) +4. [Leetcode 讨论区](https://discuss.leetcode.com/) +5. [visualgo算法可视化网站](https://visualgo.net/en) +6. [Data Structure Visualization](https://www.cs.usfca.edu/~galles/visualization/Algorithms.html) +7. [我的算法学习之路 - Lucida](http://zh.lucida.me/blog/on-learning-algorithms/) +8. [HiredInTech](https://www.hiredintech.com/) System Design 的总结特别适合入门 9. [mitcc的Github](https://github.com/mitcc/AlgoSolutions) - 10. [小土刀的面试刷题笔记](http://wdxtub.com/interview/14520594642530.html) - - - - - - - - 💪就是干! diff --git a/001._two_sum.md b/docs/001._two_sum.md similarity index 100% rename from 001._two_sum.md rename to docs/001._two_sum.md diff --git a/002._add_two_numbers.md b/docs/002._add_two_numbers.md similarity index 100% rename from 002._add_two_numbers.md rename to docs/002._add_two_numbers.md diff --git a/003._longest_substring_without_repeating_characters.md b/docs/003._longest_substring_without_repeating_characters.md similarity index 100% rename from 003._longest_substring_without_repeating_characters.md rename to docs/003._longest_substring_without_repeating_characters.md diff --git a/004._median_of_two_sorted_arrays.md b/docs/004._median_of_two_sorted_arrays.md similarity index 100% rename from 004._median_of_two_sorted_arrays.md rename to docs/004._median_of_two_sorted_arrays.md diff --git a/005._longest_palindromic_substring.md b/docs/005._longest_palindromic_substring.md similarity index 100% rename from 005._longest_palindromic_substring.md rename to docs/005._longest_palindromic_substring.md diff --git a/007._Reverse_Integer.md b/docs/007._Reverse_Integer.md similarity index 100% rename from 007._Reverse_Integer.md rename to docs/007._Reverse_Integer.md diff --git a/008._string_to_integer_(atoi).md b/docs/008._string_to_integer_(atoi).md similarity index 100% rename from 008._string_to_integer_(atoi).md rename to docs/008._string_to_integer_(atoi).md diff --git a/010._regular_expression_matching.md b/docs/010._regular_expression_matching.md similarity index 100% rename from 010._regular_expression_matching.md rename to docs/010._regular_expression_matching.md diff --git a/011._container_with_most_water.md b/docs/011._container_with_most_water.md similarity index 100% rename from 011._container_with_most_water.md rename to docs/011._container_with_most_water.md diff --git a/012._Integer_to_Roman.md b/docs/012._Integer_to_Roman.md similarity index 100% rename from 012._Integer_to_Roman.md rename to docs/012._Integer_to_Roman.md diff --git a/013._Roman_to_Integer.md b/docs/013._Roman_to_Integer.md similarity index 100% rename from 013._Roman_to_Integer.md rename to docs/013._Roman_to_Integer.md diff --git a/014._longest_common_prefix.md b/docs/014._longest_common_prefix.md similarity index 100% rename from 014._longest_common_prefix.md rename to docs/014._longest_common_prefix.md diff --git a/015._3sum.md b/docs/015._3sum.md similarity index 100% rename from 015._3sum.md rename to docs/015._3sum.md diff --git a/016._3sum_closest.md b/docs/016._3sum_closest.md similarity index 100% rename from 016._3sum_closest.md rename to docs/016._3sum_closest.md diff --git a/017._letter_combinations_of_a_phone_number.md b/docs/017._letter_combinations_of_a_phone_number.md similarity index 100% rename from 017._letter_combinations_of_a_phone_number.md rename to docs/017._letter_combinations_of_a_phone_number.md diff --git a/018._4sum.md b/docs/018._4sum.md similarity index 100% rename from 018._4sum.md rename to docs/018._4sum.md diff --git a/019._remove_nth_node_from_end_of_list.md b/docs/019._remove_nth_node_from_end_of_list.md similarity index 100% rename from 019._remove_nth_node_from_end_of_list.md rename to docs/019._remove_nth_node_from_end_of_list.md diff --git a/020._valid_parentheses.md b/docs/020._valid_parentheses.md similarity index 100% rename from 020._valid_parentheses.md rename to docs/020._valid_parentheses.md diff --git a/021._merge_two_sorted_lists.md b/docs/021._merge_two_sorted_lists.md similarity index 100% rename from 021._merge_two_sorted_lists.md rename to docs/021._merge_two_sorted_lists.md diff --git a/022._generate_parentheses.md b/docs/022._generate_parentheses.md similarity index 100% rename from 022._generate_parentheses.md rename to docs/022._generate_parentheses.md diff --git a/023._merge_k_sorted_lists.md b/docs/023._merge_k_sorted_lists.md similarity index 100% rename from 023._merge_k_sorted_lists.md rename to docs/023._merge_k_sorted_lists.md diff --git a/024._swap_nodes_in_pairs.md b/docs/024._swap_nodes_in_pairs.md similarity index 100% rename from 024._swap_nodes_in_pairs.md rename to docs/024._swap_nodes_in_pairs.md diff --git a/026._Remove_Duplicates_from_Sorted_Array.md b/docs/026._Remove_Duplicates_from_Sorted_Array.md similarity index 100% rename from 026._Remove_Duplicates_from_Sorted_Array.md rename to docs/026._Remove_Duplicates_from_Sorted_Array.md diff --git a/027._Remove_Element.md b/docs/027._Remove_Element.md similarity index 100% rename from 027._Remove_Element.md rename to docs/027._Remove_Element.md diff --git a/028._implement_strstr().md b/docs/028._implement_strstr().md similarity index 100% rename from 028._implement_strstr().md rename to docs/028._implement_strstr().md diff --git a/030._Substring_with_Concatenation_of_All_Words.md b/docs/030._Substring_with_Concatenation_of_All_Words.md similarity index 100% rename from 030._Substring_with_Concatenation_of_All_Words.md rename to docs/030._Substring_with_Concatenation_of_All_Words.md diff --git a/031._next_permutation.md b/docs/031._next_permutation.md similarity index 100% rename from 031._next_permutation.md rename to docs/031._next_permutation.md diff --git a/033._search_in_rotated_sorted_array.md b/docs/033._search_in_rotated_sorted_array.md similarity index 100% rename from 033._search_in_rotated_sorted_array.md rename to docs/033._search_in_rotated_sorted_array.md diff --git a/034._Search for a Range.md b/docs/034._Search for a Range.md similarity index 100% rename from 034._Search for a Range.md rename to docs/034._Search for a Range.md diff --git a/035._search_insert_position.md b/docs/035._search_insert_position.md similarity index 100% rename from 035._search_insert_position.md rename to docs/035._search_insert_position.md diff --git a/038._Count_and_Say.md b/docs/038._Count_and_Say.md similarity index 100% rename from 038._Count_and_Say.md rename to docs/038._Count_and_Say.md diff --git a/039._combination_sum.md b/docs/039._combination_sum.md similarity index 100% rename from 039._combination_sum.md rename to docs/039._combination_sum.md diff --git a/040._combination_sum_ii.md b/docs/040._combination_sum_ii.md similarity index 100% rename from 040._combination_sum_ii.md rename to docs/040._combination_sum_ii.md diff --git a/042._trapping_rain_water.md b/docs/042._trapping_rain_water.md similarity index 100% rename from 042._trapping_rain_water.md rename to docs/042._trapping_rain_water.md diff --git a/043._multiply_strings.md b/docs/043._multiply_strings.md similarity index 100% rename from 043._multiply_strings.md rename to docs/043._multiply_strings.md diff --git a/044._wildcard_matching.md b/docs/044._wildcard_matching.md similarity index 100% rename from 044._wildcard_matching.md rename to docs/044._wildcard_matching.md diff --git a/045._Jump_Game_II.md b/docs/045._Jump_Game_II.md similarity index 100% rename from 045._Jump_Game_II.md rename to docs/045._Jump_Game_II.md diff --git a/046._permutations.md b/docs/046._permutations.md similarity index 100% rename from 046._permutations.md rename to docs/046._permutations.md diff --git a/047._permutations_ii.md b/docs/047._permutations_ii.md similarity index 100% rename from 047._permutations_ii.md rename to docs/047._permutations_ii.md diff --git a/048._rotate_image.md b/docs/048._rotate_image.md similarity index 100% rename from 048._rotate_image.md rename to docs/048._rotate_image.md diff --git a/049._group_anagrams_python.md b/docs/049._group_anagrams_python.md similarity index 100% rename from 049._group_anagrams_python.md rename to docs/049._group_anagrams_python.md diff --git a/050._pow(x,_n).md b/docs/050._pow(x,_n).md similarity index 100% rename from 050._pow(x,_n).md rename to docs/050._pow(x,_n).md diff --git a/051._n-queens.md b/docs/051._n-queens.md similarity index 100% rename from 051._n-queens.md rename to docs/051._n-queens.md diff --git a/052._n-queens_ii.md b/docs/052._n-queens_ii.md similarity index 100% rename from 052._n-queens_ii.md rename to docs/052._n-queens_ii.md diff --git a/053._maximum_subarray.md b/docs/053._maximum_subarray.md similarity index 100% rename from 053._maximum_subarray.md rename to docs/053._maximum_subarray.md diff --git a/054._spiral_matrix.md b/docs/054._spiral_matrix.md similarity index 100% rename from 054._spiral_matrix.md rename to docs/054._spiral_matrix.md diff --git a/055._jump_game.md b/docs/055._jump_game.md similarity index 100% rename from 055._jump_game.md rename to docs/055._jump_game.md diff --git a/056._Merge_Intervals.md b/docs/056._Merge_Intervals.md similarity index 100% rename from 056._Merge_Intervals.md rename to docs/056._Merge_Intervals.md diff --git a/058._length_of_last_word.md b/docs/058._length_of_last_word.md similarity index 100% rename from 058._length_of_last_word.md rename to docs/058._length_of_last_word.md diff --git a/059._spiral_matrix_ii.md b/docs/059._spiral_matrix_ii.md similarity index 100% rename from 059._spiral_matrix_ii.md rename to docs/059._spiral_matrix_ii.md diff --git a/060._permutation_sequence.md b/docs/060._permutation_sequence.md similarity index 100% rename from 060._permutation_sequence.md rename to docs/060._permutation_sequence.md diff --git a/061._rotate_list.md b/docs/061._rotate_list.md similarity index 100% rename from 061._rotate_list.md rename to docs/061._rotate_list.md diff --git a/064._minimum_path_sum.md b/docs/064._minimum_path_sum.md similarity index 100% rename from 064._minimum_path_sum.md rename to docs/064._minimum_path_sum.md diff --git a/065.unique_paths_ii.md b/docs/065.unique_paths_ii.md similarity index 100% rename from 065.unique_paths_ii.md rename to docs/065.unique_paths_ii.md diff --git a/066._plus_one.md b/docs/066._plus_one.md similarity index 100% rename from 066._plus_one.md rename to docs/066._plus_one.md diff --git a/067._add_binary.md b/docs/067._add_binary.md similarity index 100% rename from 067._add_binary.md rename to docs/067._add_binary.md diff --git a/069._sqrt(x).md b/docs/069._sqrt(x).md similarity index 100% rename from 069._sqrt(x).md rename to docs/069._sqrt(x).md diff --git a/070. Climbing Stairs.md b/docs/070. Climbing Stairs.md similarity index 100% rename from 070. Climbing Stairs.md rename to docs/070. Climbing Stairs.md diff --git a/072._edit_distance.md b/docs/072._edit_distance.md similarity index 100% rename from 072._edit_distance.md rename to docs/072._edit_distance.md diff --git a/073. Set Matrix Zeroes.md b/docs/073. Set Matrix Zeroes.md similarity index 100% rename from 073. Set Matrix Zeroes.md rename to docs/073. Set Matrix Zeroes.md diff --git a/074._search_a_2d_matrix.md b/docs/074._search_a_2d_matrix.md similarity index 100% rename from 074._search_a_2d_matrix.md rename to docs/074._search_a_2d_matrix.md diff --git a/075._sort_colors.md b/docs/075._sort_colors.md similarity index 100% rename from 075._sort_colors.md rename to docs/075._sort_colors.md diff --git a/076._Minimum_Window_Substring.md b/docs/076._Minimum_Window_Substring.md similarity index 100% rename from 076._Minimum_Window_Substring.md rename to docs/076._Minimum_Window_Substring.md diff --git a/077._combinations.md b/docs/077._combinations.md similarity index 100% rename from 077._combinations.md rename to docs/077._combinations.md diff --git a/078.Subsets .md b/docs/078.Subsets .md similarity index 100% rename from 078.Subsets .md rename to docs/078.Subsets .md diff --git a/079._word_search.md b/docs/079._word_search.md similarity index 100% rename from 079._word_search.md rename to docs/079._word_search.md diff --git a/082._remove_duplicates_from_sorted_list_ii.md b/docs/082._remove_duplicates_from_sorted_list_ii.md similarity index 100% rename from 082._remove_duplicates_from_sorted_list_ii.md rename to docs/082._remove_duplicates_from_sorted_list_ii.md diff --git a/083._remove_duplicates_from_sorted_list.md b/docs/083._remove_duplicates_from_sorted_list.md similarity index 100% rename from 083._remove_duplicates_from_sorted_list.md rename to docs/083._remove_duplicates_from_sorted_list.md diff --git a/086._partition_list.md b/docs/086._partition_list.md similarity index 100% rename from 086._partition_list.md rename to docs/086._partition_list.md diff --git a/088._merge_sorted_array.md b/docs/088._merge_sorted_array.md similarity index 100% rename from 088._merge_sorted_array.md rename to docs/088._merge_sorted_array.md diff --git a/089._gray_code.md b/docs/089._gray_code.md similarity index 100% rename from 089._gray_code.md rename to docs/089._gray_code.md diff --git a/090._subsets_ii.md b/docs/090._subsets_ii.md similarity index 100% rename from 090._subsets_ii.md rename to docs/090._subsets_ii.md diff --git a/091._decode_ways.md b/docs/091._decode_ways.md similarity index 100% rename from 091._decode_ways.md rename to docs/091._decode_ways.md diff --git a/092._reverse_linked_list_ii.md b/docs/092._reverse_linked_list_ii.md similarity index 100% rename from 092._reverse_linked_list_ii.md rename to docs/092._reverse_linked_list_ii.md diff --git a/093._restore_ip_addresses.md b/docs/093._restore_ip_addresses.md similarity index 100% rename from 093._restore_ip_addresses.md rename to docs/093._restore_ip_addresses.md diff --git a/094._binary_tree_inorder_traversal.md b/docs/094._binary_tree_inorder_traversal.md similarity index 100% rename from 094._binary_tree_inorder_traversal.md rename to docs/094._binary_tree_inorder_traversal.md diff --git a/096._unique_binary_search_trees.md b/docs/096._unique_binary_search_trees.md similarity index 100% rename from 096._unique_binary_search_trees.md rename to docs/096._unique_binary_search_trees.md diff --git a/098._validate_binary_search_tree.md b/docs/098._validate_binary_search_tree.md similarity index 100% rename from 098._validate_binary_search_tree.md rename to docs/098._validate_binary_search_tree.md diff --git a/100._same_tree.md b/docs/100._same_tree.md similarity index 100% rename from 100._same_tree.md rename to docs/100._same_tree.md diff --git a/101._symmetric_tree.md b/docs/101._symmetric_tree.md similarity index 100% rename from 101._symmetric_tree.md rename to docs/101._symmetric_tree.md diff --git a/102._binary_tree_level_order_traversal.md b/docs/102._binary_tree_level_order_traversal.md similarity index 100% rename from 102._binary_tree_level_order_traversal.md rename to docs/102._binary_tree_level_order_traversal.md diff --git a/103._binary_tree_zigzag_level_order_traversal.md b/docs/103._binary_tree_zigzag_level_order_traversal.md similarity index 100% rename from 103._binary_tree_zigzag_level_order_traversal.md rename to docs/103._binary_tree_zigzag_level_order_traversal.md diff --git a/104._maximum_depth_of_binary_tree.md b/docs/104._maximum_depth_of_binary_tree.md similarity index 100% rename from 104._maximum_depth_of_binary_tree.md rename to docs/104._maximum_depth_of_binary_tree.md diff --git a/105._construct_binary_tree_from_preorder_and_inorder_traversal.md b/docs/105._construct_binary_tree_from_preorder_and_inorder_traversal.md similarity index 100% rename from 105._construct_binary_tree_from_preorder_and_inorder_traversal.md rename to docs/105._construct_binary_tree_from_preorder_and_inorder_traversal.md diff --git a/106._construct_binary_tree_from_inorder_and_postorder_traversal.md b/docs/106._construct_binary_tree_from_inorder_and_postorder_traversal.md similarity index 100% rename from 106._construct_binary_tree_from_inorder_and_postorder_traversal.md rename to docs/106._construct_binary_tree_from_inorder_and_postorder_traversal.md diff --git a/107._binary_tree_level_order_traversal_ii.md b/docs/107._binary_tree_level_order_traversal_ii.md similarity index 100% rename from 107._binary_tree_level_order_traversal_ii.md rename to docs/107._binary_tree_level_order_traversal_ii.md diff --git a/108._convert_sorted_array_to_binary_search_tree.md b/docs/108._convert_sorted_array_to_binary_search_tree.md similarity index 100% rename from 108._convert_sorted_array_to_binary_search_tree.md rename to docs/108._convert_sorted_array_to_binary_search_tree.md diff --git a/109._convert_sorted_list_to_binary_search_tree.md b/docs/109._convert_sorted_list_to_binary_search_tree.md similarity index 100% rename from 109._convert_sorted_list_to_binary_search_tree.md rename to docs/109._convert_sorted_list_to_binary_search_tree.md diff --git a/110._balanced_binary_tree.md b/docs/110._balanced_binary_tree.md similarity index 100% rename from 110._balanced_binary_tree.md rename to docs/110._balanced_binary_tree.md diff --git a/111._minimum_depth_of_binary_tree.md b/docs/111._minimum_depth_of_binary_tree.md similarity index 100% rename from 111._minimum_depth_of_binary_tree.md rename to docs/111._minimum_depth_of_binary_tree.md diff --git a/112._path_sum.md b/docs/112._path_sum.md similarity index 100% rename from 112._path_sum.md rename to docs/112._path_sum.md diff --git a/113._path_sum_ii.md b/docs/113._path_sum_ii.md similarity index 100% rename from 113._path_sum_ii.md rename to docs/113._path_sum_ii.md diff --git a/114._flatten_binary_tree_to_linked_list.md b/docs/114._flatten_binary_tree_to_linked_list.md similarity index 100% rename from 114._flatten_binary_tree_to_linked_list.md rename to docs/114._flatten_binary_tree_to_linked_list.md diff --git a/116._populating_next_right_pointers_in_each_node.md b/docs/116._populating_next_right_pointers_in_each_node.md similarity index 100% rename from 116._populating_next_right_pointers_in_each_node.md rename to docs/116._populating_next_right_pointers_in_each_node.md diff --git a/118._pascal's_triangle.md b/docs/118._pascal's_triangle.md similarity index 100% rename from 118._pascal's_triangle.md rename to docs/118._pascal's_triangle.md diff --git a/119. Pascal's Triangle II.md b/docs/119. Pascal's Triangle II.md similarity index 100% rename from 119. Pascal's Triangle II.md rename to docs/119. Pascal's Triangle II.md diff --git a/120. Triangle.md b/docs/120. Triangle.md similarity index 100% rename from 120. Triangle.md rename to docs/120. Triangle.md diff --git a/121._Best_Time_to_Buy_and_Sell_Stock.md b/docs/121._Best_Time_to_Buy_and_Sell_Stock.md similarity index 100% rename from 121._Best_Time_to_Buy_and_Sell_Stock.md rename to docs/121._Best_Time_to_Buy_and_Sell_Stock.md diff --git a/125._valid_palindrome.md b/docs/125._valid_palindrome.md similarity index 100% rename from 125._valid_palindrome.md rename to docs/125._valid_palindrome.md diff --git a/126. Word Ladder II.md b/docs/126. Word Ladder II.md similarity index 100% rename from 126. Word Ladder II.md rename to docs/126. Word Ladder II.md diff --git a/127._word_ladder.md b/docs/127._word_ladder.md similarity index 100% rename from 127._word_ladder.md rename to docs/127._word_ladder.md diff --git a/128._Longest_Consecutive_Sequence.md b/docs/128._Longest_Consecutive_Sequence.md similarity index 100% rename from 128._Longest_Consecutive_Sequence.md rename to docs/128._Longest_Consecutive_Sequence.md diff --git a/129._sum_root_to_leaf_numbers.md b/docs/129._sum_root_to_leaf_numbers.md similarity index 100% rename from 129._sum_root_to_leaf_numbers.md rename to docs/129._sum_root_to_leaf_numbers.md diff --git a/130._surrounded_regions.md b/docs/130._surrounded_regions.md similarity index 100% rename from 130._surrounded_regions.md rename to docs/130._surrounded_regions.md diff --git a/131._palindrome_partitioning.md b/docs/131._palindrome_partitioning.md similarity index 100% rename from 131._palindrome_partitioning.md rename to docs/131._palindrome_partitioning.md diff --git a/133._clone_graph.md b/docs/133._clone_graph.md similarity index 100% rename from 133._clone_graph.md rename to docs/133._clone_graph.md diff --git a/136._single_number.md b/docs/136._single_number.md similarity index 100% rename from 136._single_number.md rename to docs/136._single_number.md diff --git a/139._word_break.md b/docs/139._word_break.md similarity index 100% rename from 139._word_break.md rename to docs/139._word_break.md diff --git a/140._word_break_ii.md b/docs/140._word_break_ii.md similarity index 100% rename from 140._word_break_ii.md rename to docs/140._word_break_ii.md diff --git a/141._linked_list_cycle.md b/docs/141._linked_list_cycle.md similarity index 100% rename from 141._linked_list_cycle.md rename to docs/141._linked_list_cycle.md diff --git a/142_Linked_List_Cycle_II.md b/docs/142_Linked_List_Cycle_II.md similarity index 100% rename from 142_Linked_List_Cycle_II.md rename to docs/142_Linked_List_Cycle_II.md diff --git a/143._reorder_list.md b/docs/143._reorder_list.md similarity index 100% rename from 143._reorder_list.md rename to docs/143._reorder_list.md diff --git a/144._binary_tree_preorder_traversal.md b/docs/144._binary_tree_preorder_traversal.md similarity index 100% rename from 144._binary_tree_preorder_traversal.md rename to docs/144._binary_tree_preorder_traversal.md diff --git a/145._binary_tree_postorder_traversal.md b/docs/145._binary_tree_postorder_traversal.md similarity index 100% rename from 145._binary_tree_postorder_traversal.md rename to docs/145._binary_tree_postorder_traversal.md diff --git a/147._insertion_sort_list.md b/docs/147._insertion_sort_list.md similarity index 100% rename from 147._insertion_sort_list.md rename to docs/147._insertion_sort_list.md diff --git a/148._sort_list.md b/docs/148._sort_list.md similarity index 100% rename from 148._sort_list.md rename to docs/148._sort_list.md diff --git a/150._evaluate_reverse_polish_notation.md b/docs/150._evaluate_reverse_polish_notation.md similarity index 100% rename from 150._evaluate_reverse_polish_notation.md rename to docs/150._evaluate_reverse_polish_notation.md diff --git a/151._reverse_words_in_a_string.md b/docs/151._reverse_words_in_a_string.md similarity index 100% rename from 151._reverse_words_in_a_string.md rename to docs/151._reverse_words_in_a_string.md diff --git a/152._maximum_product_subarray.md b/docs/152._maximum_product_subarray.md similarity index 100% rename from 152._maximum_product_subarray.md rename to docs/152._maximum_product_subarray.md diff --git a/153._find_minimum_in_rotated_sorted_array.md b/docs/153._find_minimum_in_rotated_sorted_array.md similarity index 100% rename from 153._find_minimum_in_rotated_sorted_array.md rename to docs/153._find_minimum_in_rotated_sorted_array.md diff --git a/155._min_stack.md b/docs/155._min_stack.md similarity index 100% rename from 155._min_stack.md rename to docs/155._min_stack.md diff --git a/159._Longest_Substring_with_At_Most_Two_Distinct_Characters.md b/docs/159._Longest_Substring_with_At_Most_Two_Distinct_Characters.md similarity index 100% rename from 159._Longest_Substring_with_At_Most_Two_Distinct_Characters.md rename to docs/159._Longest_Substring_with_At_Most_Two_Distinct_Characters.md diff --git a/160._intersection_of_two_linked_lists.md b/docs/160._intersection_of_two_linked_lists.md similarity index 100% rename from 160._intersection_of_two_linked_lists.md rename to docs/160._intersection_of_two_linked_lists.md diff --git a/162._find_peak_element.md b/docs/162._find_peak_element.md similarity index 100% rename from 162._find_peak_element.md rename to docs/162._find_peak_element.md diff --git a/165._compare_version_numbers.md b/docs/165._compare_version_numbers.md similarity index 100% rename from 165._compare_version_numbers.md rename to docs/165._compare_version_numbers.md diff --git a/166._Fraction_to_Recurring_Decimal.md b/docs/166._Fraction_to_Recurring_Decimal.md similarity index 100% rename from 166._Fraction_to_Recurring_Decimal.md rename to docs/166._Fraction_to_Recurring_Decimal.md diff --git a/167._two_sum_ii_-_input_array_is_sorted.md b/docs/167._two_sum_ii_-_input_array_is_sorted.md similarity index 100% rename from 167._two_sum_ii_-_input_array_is_sorted.md rename to docs/167._two_sum_ii_-_input_array_is_sorted.md diff --git a/168._excel_sheet_column_title.md b/docs/168._excel_sheet_column_title.md similarity index 100% rename from 168._excel_sheet_column_title.md rename to docs/168._excel_sheet_column_title.md diff --git a/169._majority_element.md b/docs/169._majority_element.md similarity index 100% rename from 169._majority_element.md rename to docs/169._majority_element.md diff --git a/171._excel_sheet_column_number.md b/docs/171._excel_sheet_column_number.md similarity index 100% rename from 171._excel_sheet_column_number.md rename to docs/171._excel_sheet_column_number.md diff --git a/173._binary_search_tree_iterator.md b/docs/173._binary_search_tree_iterator.md similarity index 100% rename from 173._binary_search_tree_iterator.md rename to docs/173._binary_search_tree_iterator.md diff --git a/189._rotate_array.md b/docs/189._rotate_array.md similarity index 100% rename from 189._rotate_array.md rename to docs/189._rotate_array.md diff --git a/191._number_of_1_bits.md b/docs/191._number_of_1_bits.md similarity index 100% rename from 191._number_of_1_bits.md rename to docs/191._number_of_1_bits.md diff --git a/198._house_robber.md b/docs/198._house_robber.md similarity index 100% rename from 198._house_robber.md rename to docs/198._house_robber.md diff --git a/199._binary_tree_right_side_view.md b/docs/199._binary_tree_right_side_view.md similarity index 100% rename from 199._binary_tree_right_side_view.md rename to docs/199._binary_tree_right_side_view.md diff --git a/200._number_of_islands.md b/docs/200._number_of_islands.md similarity index 100% rename from 200._number_of_islands.md rename to docs/200._number_of_islands.md diff --git a/203._remove_linked_list_elements.md b/docs/203._remove_linked_list_elements.md similarity index 100% rename from 203._remove_linked_list_elements.md rename to docs/203._remove_linked_list_elements.md diff --git a/204._count_primes.md b/docs/204._count_primes.md similarity index 100% rename from 204._count_primes.md rename to docs/204._count_primes.md diff --git a/205._isomorphic_strings.md b/docs/205._isomorphic_strings.md similarity index 100% rename from 205._isomorphic_strings.md rename to docs/205._isomorphic_strings.md diff --git a/206._reverse_linked_list.md b/docs/206._reverse_linked_list.md similarity index 100% rename from 206._reverse_linked_list.md rename to docs/206._reverse_linked_list.md diff --git a/207._course_schedule.md b/docs/207._course_schedule.md similarity index 100% rename from 207._course_schedule.md rename to docs/207._course_schedule.md diff --git a/208._implement_trie_(prefix_tree).md b/docs/208._implement_trie_(prefix_tree).md similarity index 100% rename from 208._implement_trie_(prefix_tree).md rename to docs/208._implement_trie_(prefix_tree).md diff --git a/210._course_schedule_ii.md b/docs/210._course_schedule_ii.md similarity index 100% rename from 210._course_schedule_ii.md rename to docs/210._course_schedule_ii.md diff --git a/211. Add and Search Word - Data structure design.md b/docs/211. Add and Search Word - Data structure design.md similarity index 100% rename from 211. Add and Search Word - Data structure design.md rename to docs/211. Add and Search Word - Data structure design.md diff --git a/213._house_robber_ii.md b/docs/213._house_robber_ii.md similarity index 100% rename from 213._house_robber_ii.md rename to docs/213._house_robber_ii.md diff --git a/216._combination_sum_iii.md b/docs/216._combination_sum_iii.md similarity index 100% rename from 216._combination_sum_iii.md rename to docs/216._combination_sum_iii.md diff --git a/217._contains_duplicate.md b/docs/217._contains_duplicate.md similarity index 100% rename from 217._contains_duplicate.md rename to docs/217._contains_duplicate.md diff --git a/218._The _Skyline_Problem .md b/docs/218._The _Skyline_Problem .md similarity index 100% rename from 218._The _Skyline_Problem .md rename to docs/218._The _Skyline_Problem .md diff --git a/219._contains_duplicate_ii.md b/docs/219._contains_duplicate_ii.md similarity index 100% rename from 219._contains_duplicate_ii.md rename to docs/219._contains_duplicate_ii.md diff --git a/221._maximal_square.md b/docs/221._maximal_square.md similarity index 100% rename from 221._maximal_square.md rename to docs/221._maximal_square.md diff --git a/222._count_complete_tree_nodes.md b/docs/222._count_complete_tree_nodes.md similarity index 100% rename from 222._count_complete_tree_nodes.md rename to docs/222._count_complete_tree_nodes.md diff --git a/223._rectangle_area.md b/docs/223._rectangle_area.md similarity index 100% rename from 223._rectangle_area.md rename to docs/223._rectangle_area.md diff --git a/224. Basic Calculator .md b/docs/224. Basic Calculator .md similarity index 100% rename from 224. Basic Calculator .md rename to docs/224. Basic Calculator .md diff --git a/225._implement_stack_using_queues.md b/docs/225._implement_stack_using_queues.md similarity index 100% rename from 225._implement_stack_using_queues.md rename to docs/225._implement_stack_using_queues.md diff --git a/226._invert_binary_tree.md b/docs/226._invert_binary_tree.md similarity index 100% rename from 226._invert_binary_tree.md rename to docs/226._invert_binary_tree.md diff --git a/227._basic_calculator_ii.md b/docs/227._basic_calculator_ii.md similarity index 100% rename from 227._basic_calculator_ii.md rename to docs/227._basic_calculator_ii.md diff --git a/228._summary_ranges.md b/docs/228._summary_ranges.md similarity index 100% rename from 228._summary_ranges.md rename to docs/228._summary_ranges.md diff --git a/229._majority_element_ii.md b/docs/229._majority_element_ii.md similarity index 100% rename from 229._majority_element_ii.md rename to docs/229._majority_element_ii.md diff --git a/230._kth_smallest_element_in_a_bst.md b/docs/230._kth_smallest_element_in_a_bst.md similarity index 100% rename from 230._kth_smallest_element_in_a_bst.md rename to docs/230._kth_smallest_element_in_a_bst.md diff --git a/231. _Power_of_Two.md b/docs/231. _Power_of_Two.md similarity index 100% rename from 231. _Power_of_Two.md rename to docs/231. _Power_of_Two.md diff --git a/232._implement_queue_using_stacks.md b/docs/232._implement_queue_using_stacks.md similarity index 100% rename from 232._implement_queue_using_stacks.md rename to docs/232._implement_queue_using_stacks.md diff --git a/234._palindrome_linked_list.md b/docs/234._palindrome_linked_list.md similarity index 100% rename from 234._palindrome_linked_list.md rename to docs/234._palindrome_linked_list.md diff --git a/235._lowest_common_ancestor_of_a_binary_search_tree.md b/docs/235._lowest_common_ancestor_of_a_binary_search_tree.md similarity index 100% rename from 235._lowest_common_ancestor_of_a_binary_search_tree.md rename to docs/235._lowest_common_ancestor_of_a_binary_search_tree.md diff --git a/236._lowest_common_ancestor_of_a_binary_tree.md b/docs/236._lowest_common_ancestor_of_a_binary_tree.md similarity index 100% rename from 236._lowest_common_ancestor_of_a_binary_tree.md rename to docs/236._lowest_common_ancestor_of_a_binary_tree.md diff --git a/237._delete_node_in_a_linked_list.md b/docs/237._delete_node_in_a_linked_list.md similarity index 100% rename from 237._delete_node_in_a_linked_list.md rename to docs/237._delete_node_in_a_linked_list.md diff --git a/238._product_of_array_except_self.md b/docs/238._product_of_array_except_self.md similarity index 100% rename from 238._product_of_array_except_self.md rename to docs/238._product_of_array_except_self.md diff --git a/240._search_a_2d_matrix_ii.md b/docs/240._search_a_2d_matrix_ii.md similarity index 100% rename from 240._search_a_2d_matrix_ii.md rename to docs/240._search_a_2d_matrix_ii.md diff --git a/242._valid_anagram.md b/docs/242._valid_anagram.md similarity index 100% rename from 242._valid_anagram.md rename to docs/242._valid_anagram.md diff --git a/252. Meeting Rooms.md b/docs/252. Meeting Rooms.md similarity index 100% rename from 252. Meeting Rooms.md rename to docs/252. Meeting Rooms.md diff --git a/255._Verify_Preorder_Sequence_in_Binary_Search_Tree.md b/docs/255._Verify_Preorder_Sequence_in_Binary_Search_Tree.md similarity index 100% rename from 255._Verify_Preorder_Sequence_in_Binary_Search_Tree.md rename to docs/255._Verify_Preorder_Sequence_in_Binary_Search_Tree.md diff --git a/256. Paint House.md b/docs/256. Paint House.md similarity index 100% rename from 256. Paint House.md rename to docs/256. Paint House.md diff --git a/257._binary_tree_paths.md b/docs/257._binary_tree_paths.md similarity index 100% rename from 257._binary_tree_paths.md rename to docs/257._binary_tree_paths.md diff --git a/258_ Add_Digits.md b/docs/258_ Add_Digits.md similarity index 100% rename from 258_ Add_Digits.md rename to docs/258_ Add_Digits.md diff --git a/261. Graph Valid Tree.md b/docs/261. Graph Valid Tree.md similarity index 100% rename from 261. Graph Valid Tree.md rename to docs/261. Graph Valid Tree.md diff --git a/263._ugly_number.md b/docs/263._ugly_number.md similarity index 100% rename from 263._ugly_number.md rename to docs/263._ugly_number.md diff --git a/264._ugly_number_ii.md b/docs/264._ugly_number_ii.md similarity index 100% rename from 264._ugly_number_ii.md rename to docs/264._ugly_number_ii.md diff --git a/265. Paint House II.md b/docs/265. Paint House II.md similarity index 100% rename from 265. Paint House II.md rename to docs/265. Paint House II.md diff --git a/266. Palindrome Permutation.md b/docs/266. Palindrome Permutation.md similarity index 100% rename from 266. Palindrome Permutation.md rename to docs/266. Palindrome Permutation.md diff --git a/267. Palindrome Permutation II.md b/docs/267. Palindrome Permutation II.md similarity index 100% rename from 267. Palindrome Permutation II.md rename to docs/267. Palindrome Permutation II.md diff --git a/268._missing_number.md b/docs/268._missing_number.md similarity index 100% rename from 268._missing_number.md rename to docs/268._missing_number.md diff --git a/270. Closest Binary Search Tree Value.md b/docs/270. Closest Binary Search Tree Value.md similarity index 100% rename from 270. Closest Binary Search Tree Value.md rename to docs/270. Closest Binary Search Tree Value.md diff --git a/276. Paint Fence.md b/docs/276. Paint Fence.md similarity index 100% rename from 276. Paint Fence.md rename to docs/276. Paint Fence.md diff --git a/277. Find the Celebrity.md b/docs/277. Find the Celebrity.md similarity index 100% rename from 277. Find the Celebrity.md rename to docs/277. Find the Celebrity.md diff --git a/278._First_Bad _Version.md b/docs/278._First_Bad _Version.md similarity index 100% rename from 278._First_Bad _Version.md rename to docs/278._First_Bad _Version.md diff --git a/279._perfect_squares.md b/docs/279._perfect_squares.md similarity index 100% rename from 279._perfect_squares.md rename to docs/279._perfect_squares.md diff --git a/280._Wiggle_Sort.md b/docs/280._Wiggle_Sort.md similarity index 100% rename from 280._Wiggle_Sort.md rename to docs/280._Wiggle_Sort.md diff --git a/283._move_zeroes.md b/docs/283._move_zeroes.md similarity index 100% rename from 283._move_zeroes.md rename to docs/283._move_zeroes.md diff --git a/285._inorder_successor_in_bst.md b/docs/285._inorder_successor_in_bst.md similarity index 100% rename from 285._inorder_successor_in_bst.md rename to docs/285._inorder_successor_in_bst.md diff --git a/286. Walls and Gates.md b/docs/286. Walls and Gates.md similarity index 100% rename from 286. Walls and Gates.md rename to docs/286. Walls and Gates.md diff --git a/289._game_of_life.md b/docs/289._game_of_life.md similarity index 100% rename from 289._game_of_life.md rename to docs/289._game_of_life.md diff --git a/290._word_pattern.md b/docs/290._word_pattern.md similarity index 100% rename from 290._word_pattern.md rename to docs/290._word_pattern.md diff --git a/292._nim_game.md b/docs/292._nim_game.md similarity index 100% rename from 292._nim_game.md rename to docs/292._nim_game.md diff --git a/296. Best Meeting Point.md b/docs/296. Best Meeting Point.md similarity index 100% rename from 296. Best Meeting Point.md rename to docs/296. Best Meeting Point.md diff --git a/298. Binary Tree Longest Consecutive Sequence.md b/docs/298. Binary Tree Longest Consecutive Sequence.md similarity index 100% rename from 298. Binary Tree Longest Consecutive Sequence.md rename to docs/298. Binary Tree Longest Consecutive Sequence.md diff --git a/299._bulls_and_cows.md b/docs/299._bulls_and_cows.md similarity index 100% rename from 299._bulls_and_cows.md rename to docs/299._bulls_and_cows.md diff --git a/300._longest_increasing_subsequence.md b/docs/300._longest_increasing_subsequence.md similarity index 100% rename from 300._longest_increasing_subsequence.md rename to docs/300._longest_increasing_subsequence.md diff --git a/303._range_sum_query_-_immutable.md b/docs/303._range_sum_query_-_immutable.md similarity index 100% rename from 303._range_sum_query_-_immutable.md rename to docs/303._range_sum_query_-_immutable.md diff --git a/316._Remove_Duplicate_Letters.md b/docs/316._Remove_Duplicate_Letters.md similarity index 100% rename from 316._Remove_Duplicate_Letters.md rename to docs/316._Remove_Duplicate_Letters.md diff --git a/319._Bulb_Switcher.md b/docs/319._Bulb_Switcher.md similarity index 100% rename from 319._Bulb_Switcher.md rename to docs/319._Bulb_Switcher.md diff --git a/322. Coin Change.md b/docs/322. Coin Change.md similarity index 100% rename from 322. Coin Change.md rename to docs/322. Coin Change.md diff --git a/323. Number of Connected Components in an Undirected Graph.md b/docs/323. Number of Connected Components in an Undirected Graph.md similarity index 100% rename from 323. Number of Connected Components in an Undirected Graph.md rename to docs/323. Number of Connected Components in an Undirected Graph.md diff --git a/324._Wiggle_Sort_II.md b/docs/324._Wiggle_Sort_II.md similarity index 100% rename from 324._Wiggle_Sort_II.md rename to docs/324._Wiggle_Sort_II.md diff --git a/326._power_of_three.md b/docs/326._power_of_three.md similarity index 100% rename from 326._power_of_three.md rename to docs/326._power_of_three.md diff --git a/328._odd_even_linked_list.md b/docs/328._odd_even_linked_list.md similarity index 100% rename from 328._odd_even_linked_list.md rename to docs/328._odd_even_linked_list.md diff --git a/334._increasing_triplet_subsequence.md b/docs/334._increasing_triplet_subsequence.md similarity index 100% rename from 334._increasing_triplet_subsequence.md rename to docs/334._increasing_triplet_subsequence.md diff --git a/337._house_robber_iii.md b/docs/337._house_robber_iii.md similarity index 100% rename from 337._house_robber_iii.md rename to docs/337._house_robber_iii.md diff --git a/338. Counting Bits.md b/docs/338. Counting Bits.md similarity index 100% rename from 338. Counting Bits.md rename to docs/338. Counting Bits.md diff --git a/339. Nested List Weight Sum.md b/docs/339. Nested List Weight Sum.md similarity index 100% rename from 339. Nested List Weight Sum.md rename to docs/339. Nested List Weight Sum.md diff --git a/341._Flatten_Nested_List_Iterator.md b/docs/341._Flatten_Nested_List_Iterator.md similarity index 100% rename from 341._Flatten_Nested_List_Iterator.md rename to docs/341._Flatten_Nested_List_Iterator.md diff --git a/342._Power_of_Four.md b/docs/342._Power_of_Four.md similarity index 100% rename from 342._Power_of_Four.md rename to docs/342._Power_of_Four.md diff --git a/344._reverse_string.md b/docs/344._reverse_string.md similarity index 100% rename from 344._reverse_string.md rename to docs/344._reverse_string.md diff --git a/345._Reverse_Vowels_of_a_String.md b/docs/345._Reverse_Vowels_of_a_String.md similarity index 100% rename from 345._Reverse_Vowels_of_a_String.md rename to docs/345._Reverse_Vowels_of_a_String.md diff --git a/349._intersection_of_two_arrays.md b/docs/349._intersection_of_two_arrays.md similarity index 100% rename from 349._intersection_of_two_arrays.md rename to docs/349._intersection_of_two_arrays.md diff --git a/350._intersection_of_two_arrays_ii.md b/docs/350._intersection_of_two_arrays_ii.md similarity index 100% rename from 350._intersection_of_two_arrays_ii.md rename to docs/350._intersection_of_two_arrays_ii.md diff --git a/353. Design Snake Game.md b/docs/353. Design Snake Game.md similarity index 100% rename from 353. Design Snake Game.md rename to docs/353. Design Snake Game.md diff --git a/364. Nested List Weight Sum II.md b/docs/364. Nested List Weight Sum II.md similarity index 100% rename from 364. Nested List Weight Sum II.md rename to docs/364. Nested List Weight Sum II.md diff --git a/366. Find Leaves of Binary Tree.md b/docs/366. Find Leaves of Binary Tree.md similarity index 100% rename from 366. Find Leaves of Binary Tree.md rename to docs/366. Find Leaves of Binary Tree.md diff --git a/367._valid_perfect_square.md b/docs/367._valid_perfect_square.md similarity index 100% rename from 367._valid_perfect_square.md rename to docs/367._valid_perfect_square.md diff --git a/369.Plus One Linked List.md b/docs/369.Plus One Linked List.md similarity index 100% rename from 369.Plus One Linked List.md rename to docs/369.Plus One Linked List.md diff --git a/371._sum_of_two_integers.md b/docs/371._sum_of_two_integers.md similarity index 100% rename from 371._sum_of_two_integers.md rename to docs/371._sum_of_two_integers.md diff --git a/374._Guess_Number_Higher_or_Lower.md b/docs/374._Guess_Number_Higher_or_Lower.md similarity index 100% rename from 374._Guess_Number_Higher_or_Lower.md rename to docs/374._Guess_Number_Higher_or_Lower.md diff --git a/377._combination_sum_iv.md b/docs/377._combination_sum_iv.md similarity index 100% rename from 377._combination_sum_iv.md rename to docs/377._combination_sum_iv.md diff --git a/378._kth_smallest_element_in_a_sorted_matrix.md b/docs/378._kth_smallest_element_in_a_sorted_matrix.md similarity index 100% rename from 378._kth_smallest_element_in_a_sorted_matrix.md rename to docs/378._kth_smallest_element_in_a_sorted_matrix.md diff --git a/380. Insert Delete GetRandom O(1).md b/docs/380. Insert Delete GetRandom O(1).md similarity index 100% rename from 380. Insert Delete GetRandom O(1).md rename to docs/380. Insert Delete GetRandom O(1).md diff --git a/381. Insert Delete GetRandom O(1) - Duplicates allowed.md b/docs/381. Insert Delete GetRandom O(1) - Duplicates allowed.md similarity index 100% rename from 381. Insert Delete GetRandom O(1) - Duplicates allowed.md rename to docs/381. Insert Delete GetRandom O(1) - Duplicates allowed.md diff --git a/382._linked_list_random_node.md b/docs/382._linked_list_random_node.md similarity index 100% rename from 382._linked_list_random_node.md rename to docs/382._linked_list_random_node.md diff --git a/383._ransom_note.md b/docs/383._ransom_note.md similarity index 100% rename from 383._ransom_note.md rename to docs/383._ransom_note.md diff --git a/384. Shuffle an Array.md b/docs/384. Shuffle an Array.md similarity index 100% rename from 384. Shuffle an Array.md rename to docs/384. Shuffle an Array.md diff --git a/387._first_unique_character_in_a_string.md b/docs/387._first_unique_character_in_a_string.md similarity index 100% rename from 387._first_unique_character_in_a_string.md rename to docs/387._first_unique_character_in_a_string.md diff --git a/388._Longest_Absolute_File_Path.md b/docs/388._Longest_Absolute_File_Path.md similarity index 100% rename from 388._Longest_Absolute_File_Path.md rename to docs/388._Longest_Absolute_File_Path.md diff --git a/389._find_the_difference.md b/docs/389._find_the_difference.md similarity index 100% rename from 389._find_the_difference.md rename to docs/389._find_the_difference.md diff --git a/392._is_subsequence.md b/docs/392._is_subsequence.md similarity index 100% rename from 392._is_subsequence.md rename to docs/392._is_subsequence.md diff --git a/394._decode_string.md b/docs/394._decode_string.md similarity index 100% rename from 394._decode_string.md rename to docs/394._decode_string.md diff --git a/400. Nth Digit.md b/docs/400. Nth Digit.md similarity index 100% rename from 400. Nth Digit.md rename to docs/400. Nth Digit.md diff --git a/401._binary_watch.md b/docs/401._binary_watch.md similarity index 100% rename from 401._binary_watch.md rename to docs/401._binary_watch.md diff --git a/404._sum_of_left_leaves.md b/docs/404._sum_of_left_leaves.md similarity index 100% rename from 404._sum_of_left_leaves.md rename to docs/404._sum_of_left_leaves.md diff --git a/405. Convert a Number to Hexadecimal.md b/docs/405. Convert a Number to Hexadecimal.md similarity index 100% rename from 405. Convert a Number to Hexadecimal.md rename to docs/405. Convert a Number to Hexadecimal.md diff --git a/406._Queue_Reconstruction_by_Height.md b/docs/406._Queue_Reconstruction_by_Height.md similarity index 100% rename from 406._Queue_Reconstruction_by_Height.md rename to docs/406._Queue_Reconstruction_by_Height.md diff --git a/412._fizz_buzz.md b/docs/412._fizz_buzz.md similarity index 100% rename from 412._fizz_buzz.md rename to docs/412._fizz_buzz.md diff --git a/413. Arithmetic Slices.md b/docs/413. Arithmetic Slices.md similarity index 100% rename from 413. Arithmetic Slices.md rename to docs/413. Arithmetic Slices.md diff --git a/414._third_maximum_number.md b/docs/414._third_maximum_number.md similarity index 100% rename from 414._third_maximum_number.md rename to docs/414._third_maximum_number.md diff --git a/415._add_strings.md b/docs/415._add_strings.md similarity index 100% rename from 415._add_strings.md rename to docs/415._add_strings.md diff --git a/416. Partition Equal Subset Sum.md b/docs/416. Partition Equal Subset Sum.md similarity index 100% rename from 416. Partition Equal Subset Sum.md rename to docs/416. Partition Equal Subset Sum.md diff --git a/421._Maximum_XOR_of_Two_Numbers_in_an_Array.md b/docs/421._Maximum_XOR_of_Two_Numbers_in_an_Array.md similarity index 100% rename from 421._Maximum_XOR_of_Two_Numbers_in_an_Array.md rename to docs/421._Maximum_XOR_of_Two_Numbers_in_an_Array.md diff --git a/422. Valid Word Square.md b/docs/422. Valid Word Square.md similarity index 100% rename from 422. Valid Word Square.md rename to docs/422. Valid Word Square.md diff --git a/434._number_of_segments_in_a_string.md b/docs/434._number_of_segments_in_a_string.md similarity index 100% rename from 434._number_of_segments_in_a_string.md rename to docs/434._number_of_segments_in_a_string.md diff --git a/437._path_sum_iii.md b/docs/437._path_sum_iii.md similarity index 100% rename from 437._path_sum_iii.md rename to docs/437._path_sum_iii.md diff --git a/438._Find_All_Anagrams_in_a_String.md b/docs/438._Find_All_Anagrams_in_a_String.md similarity index 100% rename from 438._Find_All_Anagrams_in_a_String.md rename to docs/438._Find_All_Anagrams_in_a_String.md diff --git a/439. Ternary Expression Parser.md b/docs/439. Ternary Expression Parser.md similarity index 100% rename from 439. Ternary Expression Parser.md rename to docs/439. Ternary Expression Parser.md diff --git a/441._arranging_coins.md b/docs/441._arranging_coins.md similarity index 100% rename from 441._arranging_coins.md rename to docs/441._arranging_coins.md diff --git a/448._Find_All_Numbers_Disappeared_in_an_Array.md b/docs/448._Find_All_Numbers_Disappeared_in_an_Array.md similarity index 100% rename from 448._Find_All_Numbers_Disappeared_in_an_Array.md rename to docs/448._Find_All_Numbers_Disappeared_in_an_Array.md diff --git a/450. Delete Node in a BST.md b/docs/450. Delete Node in a BST.md similarity index 100% rename from 450. Delete Node in a BST.md rename to docs/450. Delete Node in a BST.md diff --git a/453._Minimum_Moves_to_Equal_Array_Elements.md b/docs/453._Minimum_Moves_to_Equal_Array_Elements.md similarity index 100% rename from 453._Minimum_Moves_to_Equal_Array_Elements.md rename to docs/453._Minimum_Moves_to_Equal_Array_Elements.md diff --git a/459._Repeated_Substring_Pattern.md b/docs/459._Repeated_Substring_Pattern.md similarity index 100% rename from 459._Repeated_Substring_Pattern.md rename to docs/459._Repeated_Substring_Pattern.md diff --git a/461._Hamming Distance.md b/docs/461._Hamming Distance.md similarity index 100% rename from 461._Hamming Distance.md rename to docs/461._Hamming Distance.md diff --git a/463._Island_Perimeter.md b/docs/463._Island_Perimeter.md similarity index 100% rename from 463._Island_Perimeter.md rename to docs/463._Island_Perimeter.md diff --git a/467._Unique_Substrings_in_Wraparound_String.md b/docs/467._Unique_Substrings_in_Wraparound_String.md similarity index 100% rename from 467._Unique_Substrings_in_Wraparound_String.md rename to docs/467._Unique_Substrings_in_Wraparound_String.md diff --git a/469. Convex Polygon.md b/docs/469. Convex Polygon.md similarity index 100% rename from 469. Convex Polygon.md rename to docs/469. Convex Polygon.md diff --git a/476._Number_Complement.md b/docs/476._Number_Complement.md similarity index 100% rename from 476._Number_Complement.md rename to docs/476._Number_Complement.md diff --git a/477._Total_Hamming_Distance.md b/docs/477._Total_Hamming_Distance.md similarity index 100% rename from 477._Total_Hamming_Distance.md rename to docs/477._Total_Hamming_Distance.md diff --git a/485._Max_Consecutive_Ones.md b/docs/485._Max_Consecutive_Ones.md similarity index 100% rename from 485._Max_Consecutive_Ones.md rename to docs/485._Max_Consecutive_Ones.md diff --git a/587._Erect_the_Fence .md b/docs/587._Erect_the_Fence .md similarity index 100% rename from 587._Erect_the_Fence .md rename to docs/587._Erect_the_Fence .md diff --git a/599._Minimum_Index_Sum_of_Two_Lists.md b/docs/599._Minimum_Index_Sum_of_Two_Lists.md similarity index 100% rename from 599._Minimum_Index_Sum_of_Two_Lists.md rename to docs/599._Minimum_Index_Sum_of_Two_Lists.md diff --git a/647._Palindromic_Substrings.md b/docs/647._Palindromic_Substrings.md similarity index 100% rename from 647._Palindromic_Substrings.md rename to docs/647._Palindromic_Substrings.md diff --git a/657._Judge_Route_Circle.md b/docs/657._Judge_Route_Circle.md similarity index 100% rename from 657._Judge_Route_Circle.md rename to docs/657._Judge_Route_Circle.md diff --git a/665._Non-decreasing_Array.md b/docs/665._Non-decreasing_Array.md similarity index 100% rename from 665._Non-decreasing_Array.md rename to docs/665._Non-decreasing_Array.md diff --git a/672._Bulb_Switcher_II.md b/docs/672._Bulb_Switcher_II.md similarity index 100% rename from 672._Bulb_Switcher_II.md rename to docs/672._Bulb_Switcher_II.md diff --git a/681._Next_Closest_Time.md b/docs/681._Next_Closest_Time.md similarity index 100% rename from 681._Next_Closest_Time.md rename to docs/681._Next_Closest_Time.md diff --git a/682._Baseball_Game.md b/docs/682._Baseball_Game.md similarity index 100% rename from 682._Baseball_Game.md rename to docs/682._Baseball_Game.md diff --git a/687._Longest_Univalue_Path.md b/docs/687._Longest_Univalue_Path.md similarity index 100% rename from 687._Longest_Univalue_Path.md rename to docs/687._Longest_Univalue_Path.md diff --git a/740._delete_and_earn.md b/docs/740._delete_and_earn.md similarity index 100% rename from 740._delete_and_earn.md rename to docs/740._delete_and_earn.md diff --git a/760._Find_Anagram_Mappings.md b/docs/760._Find_Anagram_Mappings.md similarity index 100% rename from 760._Find_Anagram_Mappings.md rename to docs/760._Find_Anagram_Mappings.md diff --git "a/Python\345\210\267\351\242\230\346\212\200\345\267\247\347\254\224\350\256\260.py" "b/docs/SortingAlgorithm/Python\345\210\267\351\242\230\346\212\200\345\267\247\347\254\224\350\256\260.py" similarity index 100% rename from "Python\345\210\267\351\242\230\346\212\200\345\267\247\347\254\224\350\256\260.py" rename to "docs/SortingAlgorithm/Python\345\210\267\351\242\230\346\212\200\345\267\247\347\254\224\350\256\260.py" diff --git "a/python\345\256\236\347\216\260\345\205\253\345\244\247\346\216\222\345\272\217.md" b/docs/SortingAlgorithm/README.md similarity index 92% rename from "python\345\256\236\347\216\260\345\205\253\345\244\247\346\216\222\345\272\217.md" rename to docs/SortingAlgorithm/README.md index b45d9c9ffe68e22366dfe2f0d560beaf30e02721..189bfb603c657329e3e8e0514cb320ed7a7fd764 100644 --- "a/python\345\256\236\347\216\260\345\205\253\345\244\247\346\216\222\345\272\217.md" +++ b/docs/SortingAlgorithm/README.md @@ -2,15 +2,15 @@ 八大排序,三大查找是《数据结构》当中非常基础的知识点,在这里为了复习顺带总结了一下常见的八种排序算法。 常见的八大排序算法,他们之间关系如下: -![](https://github.com/Lisanaaa/thinking_in_lc/blob/master/images/%E5%85%AB%E5%A4%A7%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95%E6%80%BB%E7%BB%93.png) +![](/images/SortingAlgorithm/八大排序算法总结.png) 他们的性能比较: -![](https://github.com/Lisanaaa/thinking_in_lc/blob/master/images/%E5%85%AB%E5%A4%A7%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95%E6%80%A7%E8%83%BD%E6%AF%94%E8%BE%83.png) +![](/images/SortingAlgorithm/八大排序算法性能.png) ### 直接插入排序 (Insertion sort) -![](https://github.com/Lisanaaa/thinking_in_lc/blob/master/images/%E7%9B%B4%E6%8E%A5%E6%8F%92%E5%85%A5%E6%8E%92%E5%BA%8F.gif) +![](/images/SortingAlgorithm/直接插入排序.gif) 直接插入排序的核心思想就是:将数组中的所有元素依次跟前面已经排好的元素相比较,如果选择的元素比已排序的元素小,则交换,直到全部元素都比较过。 因此,从上面的描述中我们可以发现,直接插入排序可以用两个循环完成: @@ -33,7 +33,7 @@ def insert_sort(L): ``` ### 希尔排序 (Shell sort) -![](https://github.com/Lisanaaa/thinking_in_lc/blob/master/images/%E5%B8%8C%E5%B0%94%E6%8E%92%E5%BA%8F.png) +![](/images/SortingAlgorithm/希尔排序.png) 希尔排序的算法思想:将待排序数组按照步长gap进行分组,然后将每组的元素利用直接插入排序的方法进行排序;每次将gap折半减小,循环上述操作;当gap=1时,利用直接插入,完成排序。 同样的:从上面的描述中我们可以发现:希尔排序的总体实现应该由三个循环完成: @@ -62,7 +62,7 @@ def insert_shell(L): ### 简单选择排序 (Selection sort) -![](https://github.com/Lisanaaa/thinking_in_lc/blob/master/images/%E7%AE%80%E5%8D%95%E9%80%89%E6%8B%A9%E6%8E%92%E5%BA%8F.gif) +![](/images/SortingAlgorithm/简单选择排序.gif) 简单选择排序的基本思想:比较+交换。 @@ -102,7 +102,7 @@ def select_sort(L): (这样满足了大顶堆那条性质:位于根节点的元素一定是当前序列的最大值) -![](https://github.com/Lisanaaa/thinking_in_lc/blob/master/images/%E6%9E%84%E5%BB%BA%E5%A4%A7%E9%A1%B6%E5%A0%86.png) +![](/images/SortingAlgorithm/构建大顶堆.png) 2. 取出当前大顶堆的根节点,将其与序列末尾元素进行交换; @@ -110,7 +110,7 @@ def select_sort(L): 3. 对交换后的n-1个序列元素进行调整,使其满足大顶堆的性质; -![](https://github.com/Lisanaaa/thinking_in_lc/blob/master/images/%E8%B0%83%E6%95%B4%E5%A4%A7%E9%A1%B6%E5%A0%86.png) +![](/images/SortingAlgorithm/调整大顶堆.png) 4. 重复2.3步骤,直至堆中只有1个元素为止 @@ -161,7 +161,7 @@ def heap_sort(L): ``` ### 冒泡排序 (Bubble sort) -![](https://github.com/Lisanaaa/thinking_in_lc/blob/master/images/%E5%86%92%E6%B3%A1%E6%8E%92%E5%BA%8F.gif) +![](/images/SortingAlgorithm/冒泡排序.gif) 冒泡排序思路比较简单: @@ -186,7 +186,7 @@ def bubble_sort(L): ### 快速排序 (Quick sort) -![](https://github.com/Lisanaaa/thinking_in_lc/blob/master/images/%E5%BF%AB%E9%80%9F%E6%8E%92%E5%BA%8F.gif) +![](/images/SortingAlgorithm/快速排序.gif) 快速排序的基本思想:挖坑填数+分治法 @@ -235,7 +235,7 @@ def quick_sort(L, start, end): ### 归并排序 (Merge sort) -![](https://github.com/Lisanaaa/thinking_in_lc/blob/master/images/%E5%BD%92%E5%B9%B6%E6%8E%92%E5%BA%8F.gif) +![](/images/SortingAlgorithm/归并排序.gif) 1. 归并排序是建立在归并操作上的一种有效的排序算法,该算法是采用分治法的一个典型的应用。它的基本操作是:将已有的子序列合并,达到完全有序的序列;即先使每个子序列有序,再使子序列段间有序。 2. 归并排序其实要做两件事: @@ -302,7 +302,7 @@ def merge_sort_array(L): ### 基数排序 (Radix sort) -![](https://github.com/Lisanaaa/thinking_in_lc/blob/master/images/%E5%9F%BA%E6%95%B0%E6%8E%92%E5%BA%8F.gif) +![](/images/SortingAlgorithm/基数排序.gif) 1. 基数排序:通过序列中各个元素的值,对排序的N个元素进行若干趟的“分配”与“收集”来实现排序。 - 分配:我们将L[i]中的元素取出,首先确定其个位上的数字,根据该数字分配到与之序号相同的桶中 diff --git "a/python\347\232\204\345\220\204\347\247\215pass.md" "b/docs/SortingAlgorithm/python\347\232\204\345\220\204\347\247\215pass.md" similarity index 100% rename from "python\347\232\204\345\220\204\347\247\215pass.md" rename to "docs/SortingAlgorithm/python\347\232\204\345\220\204\347\247\215pass.md" diff --git "a/tree_search\357\274\214_graph_search\357\274\214_dfs,_bfs.md" "b/docs/SortingAlgorithm/tree_search\357\274\214_graph_search\357\274\214_dfs,_bfs.md" similarity index 100% rename from "tree_search\357\274\214_graph_search\357\274\214_dfs,_bfs.md" rename to "docs/SortingAlgorithm/tree_search\357\274\214_graph_search\357\274\214_dfs,_bfs.md" diff --git a/interview question/Google/Google.md b/docs/interview/Google/Google.md similarity index 100% rename from interview question/Google/Google.md rename to docs/interview/Google/Google.md diff --git a/interview question/WePay/WePay.jpg b/docs/interview/WePay/WePay.jpg similarity index 100% rename from interview question/WePay/WePay.jpg rename to docs/interview/WePay/WePay.jpg diff --git a/interview question/WePay/WePay.md b/docs/interview/WePay/WePay.md similarity index 100% rename from interview question/WePay/WePay.md rename to docs/interview/WePay/WePay.md diff --git a/interview question/WePay/power_number.md b/docs/interview/WePay/power_number.md similarity index 100% rename from interview question/WePay/power_number.md rename to docs/interview/WePay/power_number.md diff --git a/interview question/pocketgems/pocketgems.md b/docs/interview/pocketgems/pocketgems.md similarity index 100% rename from interview question/pocketgems/pocketgems.md rename to docs/interview/pocketgems/pocketgems.md diff --git "a/images/\345\205\253\345\244\247\346\216\222\345\272\217\347\256\227\346\263\225\346\200\247\350\203\275\346\257\224\350\276\203.png" "b/images/SortingAlgorithm/\345\205\253\345\244\247\346\216\222\345\272\217\347\256\227\346\263\225\346\200\247\350\203\275.png" similarity index 100% rename from "images/\345\205\253\345\244\247\346\216\222\345\272\217\347\256\227\346\263\225\346\200\247\350\203\275\346\257\224\350\276\203.png" rename to "images/SortingAlgorithm/\345\205\253\345\244\247\346\216\222\345\272\217\347\256\227\346\263\225\346\200\247\350\203\275.png" diff --git "a/images/\345\205\253\345\244\247\346\216\222\345\272\217\347\256\227\346\263\225\346\200\273\347\273\223.png" "b/images/SortingAlgorithm/\345\205\253\345\244\247\346\216\222\345\272\217\347\256\227\346\263\225\346\200\273\347\273\223.png" similarity index 100% rename from "images/\345\205\253\345\244\247\346\216\222\345\272\217\347\256\227\346\263\225\346\200\273\347\273\223.png" rename to "images/SortingAlgorithm/\345\205\253\345\244\247\346\216\222\345\272\217\347\256\227\346\263\225\346\200\273\347\273\223.png" diff --git "a/images/\345\206\222\346\263\241\346\216\222\345\272\217.gif" "b/images/SortingAlgorithm/\345\206\222\346\263\241\346\216\222\345\272\217.gif" similarity index 100% rename from "images/\345\206\222\346\263\241\346\216\222\345\272\217.gif" rename to "images/SortingAlgorithm/\345\206\222\346\263\241\346\216\222\345\272\217.gif" diff --git "a/images/\345\237\272\346\225\260\346\216\222\345\272\217.gif" "b/images/SortingAlgorithm/\345\237\272\346\225\260\346\216\222\345\272\217.gif" similarity index 100% rename from "images/\345\237\272\346\225\260\346\216\222\345\272\217.gif" rename to "images/SortingAlgorithm/\345\237\272\346\225\260\346\216\222\345\272\217.gif" diff --git "a/images/\345\270\214\345\260\224\346\216\222\345\272\217.png" "b/images/SortingAlgorithm/\345\270\214\345\260\224\346\216\222\345\272\217.png" similarity index 100% rename from "images/\345\270\214\345\260\224\346\216\222\345\272\217.png" rename to "images/SortingAlgorithm/\345\270\214\345\260\224\346\216\222\345\272\217.png" diff --git "a/images/\345\275\222\345\271\266\346\216\222\345\272\217.gif" "b/images/SortingAlgorithm/\345\275\222\345\271\266\346\216\222\345\272\217.gif" similarity index 100% rename from "images/\345\275\222\345\271\266\346\216\222\345\272\217.gif" rename to "images/SortingAlgorithm/\345\275\222\345\271\266\346\216\222\345\272\217.gif" diff --git "a/images/\345\277\253\351\200\237\346\216\222\345\272\217.gif" "b/images/SortingAlgorithm/\345\277\253\351\200\237\346\216\222\345\272\217.gif" similarity index 100% rename from "images/\345\277\253\351\200\237\346\216\222\345\272\217.gif" rename to "images/SortingAlgorithm/\345\277\253\351\200\237\346\216\222\345\272\217.gif" diff --git "a/images/\346\236\204\345\273\272\345\244\247\351\241\266\345\240\206.png" "b/images/SortingAlgorithm/\346\236\204\345\273\272\345\244\247\351\241\266\345\240\206.png" similarity index 100% rename from "images/\346\236\204\345\273\272\345\244\247\351\241\266\345\240\206.png" rename to "images/SortingAlgorithm/\346\236\204\345\273\272\345\244\247\351\241\266\345\240\206.png" diff --git "a/images/\347\233\264\346\216\245\346\217\222\345\205\245\346\216\222\345\272\217.gif" "b/images/SortingAlgorithm/\347\233\264\346\216\245\346\217\222\345\205\245\346\216\222\345\272\217.gif" similarity index 100% rename from "images/\347\233\264\346\216\245\346\217\222\345\205\245\346\216\222\345\272\217.gif" rename to "images/SortingAlgorithm/\347\233\264\346\216\245\346\217\222\345\205\245\346\216\222\345\272\217.gif" diff --git "a/images/\347\256\200\345\215\225\351\200\211\346\213\251\346\216\222\345\272\217.gif" "b/images/SortingAlgorithm/\347\256\200\345\215\225\351\200\211\346\213\251\346\216\222\345\272\217.gif" similarity index 100% rename from "images/\347\256\200\345\215\225\351\200\211\346\213\251\346\216\222\345\272\217.gif" rename to "images/SortingAlgorithm/\347\256\200\345\215\225\351\200\211\346\213\251\346\216\222\345\272\217.gif" diff --git "a/images/\350\260\203\346\225\264\345\244\247\351\241\266\345\240\206.png" "b/images/SortingAlgorithm/\350\260\203\346\225\264\345\244\247\351\241\266\345\240\206.png" similarity index 100% rename from "images/\350\260\203\346\225\264\345\244\247\351\241\266\345\240\206.png" rename to "images/SortingAlgorithm/\350\260\203\346\225\264\345\244\247\351\241\266\345\240\206.png" diff --git "a/Binary Search \344\270\215\346\230\223\345\206\231.md" "b/others/Binary Search \344\270\215\346\230\223\345\206\231.md" similarity index 100% rename from "Binary Search \344\270\215\346\230\223\345\206\231.md" rename to "others/Binary Search \344\270\215\346\230\223\345\206\231.md" diff --git a/Data Structure and Algorthim Review.md b/others/Data Structure and Algorthim Review.md similarity index 100% rename from Data Structure and Algorthim Review.md rename to others/Data Structure and Algorthim Review.md diff --git a/Dynamic Programming.md b/others/Dynamic Programming.md similarity index 100% rename from Dynamic Programming.md rename to others/Dynamic Programming.md diff --git "a/Introduction to String Searching Algorithms \342\200\223 topcoder.pdf" "b/others/Introduction to String Searching Algorithms \342\200\223 topcoder.pdf" similarity index 100% rename from "Introduction to String Searching Algorithms \342\200\223 topcoder.pdf" rename to "others/Introduction to String Searching Algorithms \342\200\223 topcoder.pdf" diff --git "a/Java\345\220\204\347\247\215\347\261\273\345\236\213\347\232\204\350\275\254\346\215\242.md" "b/others/Java\345\220\204\347\247\215\347\261\273\345\236\213\347\232\204\350\275\254\346\215\242.md" similarity index 100% rename from "Java\345\220\204\347\247\215\347\261\273\345\236\213\347\232\204\350\275\254\346\215\242.md" rename to "others/Java\345\220\204\347\247\215\347\261\273\345\236\213\347\232\204\350\275\254\346\215\242.md" diff --git "a/LinkedList\346\212\200\345\267\247.md" "b/others/LinkedList\346\212\200\345\267\247.md" similarity index 100% rename from "LinkedList\346\212\200\345\267\247.md" rename to "others/LinkedList\346\212\200\345\267\247.md" diff --git a/Maximal Square.pdf b/others/Maximal Square.pdf similarity index 100% rename from Maximal Square.pdf rename to others/Maximal Square.pdf diff --git a/Range Sum Query 2D - Immutable.pdf b/others/Range Sum Query 2D - Immutable.pdf similarity index 100% rename from Range Sum Query 2D - Immutable.pdf rename to others/Range Sum Query 2D - Immutable.pdf diff --git a/Recusrion & BackTracking.md b/others/Recusrion & BackTracking.md similarity index 100% rename from Recusrion & BackTracking.md rename to others/Recusrion & BackTracking.md diff --git "a/backtracking\346\200\235\350\267\257.md" "b/others/backtracking\346\200\235\350\267\257.md" similarity index 100% rename from "backtracking\346\200\235\350\267\257.md" rename to "others/backtracking\346\200\235\350\267\257.md" diff --git "a/delete_node_in_a_linked_list\351\227\256\351\242\230.md" "b/others/delete_node_in_a_linked_list\351\227\256\351\242\230.md" similarity index 100% rename from "delete_node_in_a_linked_list\351\227\256\351\242\230.md" rename to "others/delete_node_in_a_linked_list\351\227\256\351\242\230.md" diff --git "a/local_search\357\274\214_\344\270\200\344\272\233\346\226\260\347\232\204\346\200\235\350\267\257.md" "b/others/local_search\357\274\214_\344\270\200\344\272\233\346\226\260\347\232\204\346\200\235\350\267\257.md" similarity index 100% rename from "local_search\357\274\214_\344\270\200\344\272\233\346\226\260\347\232\204\346\200\235\350\267\257.md" rename to "others/local_search\357\274\214_\344\270\200\344\272\233\346\226\260\347\232\204\346\200\235\350\267\257.md" diff --git a/slide_windows_template.md b/others/slide_windows_template.md similarity index 100% rename from slide_windows_template.md rename to others/slide_windows_template.md diff --git "a/\344\275\215\350\277\220\347\256\227.md" "b/others/\344\275\215\350\277\220\347\256\227.md" similarity index 100% rename from "\344\275\215\350\277\220\347\256\227.md" rename to "others/\344\275\215\350\277\220\347\256\227.md" diff --git "a/\345\205\250\346\216\222\345\210\227\347\256\227\346\263\225.md" "b/others/\345\205\250\346\216\222\345\210\227\347\256\227\346\263\225.md" similarity index 100% rename from "\345\205\250\346\216\222\345\210\227\347\256\227\346\263\225.md" rename to "others/\345\205\250\346\216\222\345\210\227\347\256\227\346\263\225.md" diff --git "a/\345\255\220\351\233\206\345\220\210\351\227\256\351\242\230.md" "b/others/\345\255\220\351\233\206\345\220\210\351\227\256\351\242\230.md" similarity index 100% rename from "\345\255\220\351\233\206\345\220\210\351\227\256\351\242\230.md" rename to "others/\345\255\220\351\233\206\345\220\210\351\227\256\351\242\230.md" diff --git "a/\346\200\273\347\273\223.md" "b/others/\346\200\273\347\273\223.md" similarity index 100% rename from "\346\200\273\347\273\223.md" rename to "others/\346\200\273\347\273\223.md" diff --git "a/\347\273\204\345\220\210\351\227\256\351\242\230.md" "b/others/\347\273\204\345\220\210\351\227\256\351\242\230.md" similarity index 100% rename from "\347\273\204\345\220\210\351\227\256\351\242\230.md" rename to "others/\347\273\204\345\220\210\351\227\256\351\242\230.md" diff --git "a/\351\200\222\345\275\222_recursion.md" "b/others/\351\200\222\345\275\222_recursion.md" similarity index 100% rename from "\351\200\222\345\275\222_recursion.md" rename to "others/\351\200\222\345\275\222_recursion.md" diff --git a/src/py2.x/SortingAlgorithm/BubbleSort.py b/src/py2.x/SortingAlgorithm/BubbleSort.py new file mode 100644 index 0000000000000000000000000000000000000000..6e2f2394041f76673c687c85a8efc93b2d5e69f9 --- /dev/null +++ b/src/py2.x/SortingAlgorithm/BubbleSort.py @@ -0,0 +1,19 @@ +# coding:utf-8 + + +# 冒泡排序 +def bubble_sort(l): + length = len(l) + # 外层循环 length遍,内层循环少一遍 + while length: + for j in range(length - 1): + # 找出最大值,然后交换位置到最后 + if l[j] > l[length - 1]: + l[j], l[length - 1] = l[length - 1], l[j] + length -= 1 + + +if __name__ == "__main__": + l = [5, 1, 9, 3, 2, 7] + bubble_sort(l) + print l diff --git a/src/py2.x/SortingAlgorithm/InsertSort.py b/src/py2.x/SortingAlgorithm/InsertSort.py new file mode 100644 index 0000000000000000000000000000000000000000..09b935114a0df367fe7cbc815950f6605645232c --- /dev/null +++ b/src/py2.x/SortingAlgorithm/InsertSort.py @@ -0,0 +1,24 @@ +# coding:utf8 +""" +插入排序和冒泡排序的区别在于: + +插入排序的前提是:左边是有序的数列 +而冒泡排序:相邻的值进行交换,一共进行n次交换 +""" + + +def insert_sort(l): + # 循环 除第一个数字组成的有序数组 以外的数字 + for i in range(1, len(l)): + # 每一个数字,依次和有序数组进行比较 + print l[:i] + for j in range(len(l[:i])): + if l[i] < l[j]: + l[i], l[j] = l[j], l[i] + + +if __name__ == "__main__": + l = [5, 1, 9, 3, 2, 7] + print l + insert_sort(l) + print("result: " + str(l)) diff --git a/src/py2.x/SortingAlgorithm/MergeSort.py b/src/py2.x/SortingAlgorithm/MergeSort.py new file mode 100644 index 0000000000000000000000000000000000000000..1ad19e86df8388f384a209190d3d8603d8b222d4 --- /dev/null +++ b/src/py2.x/SortingAlgorithm/MergeSort.py @@ -0,0 +1,35 @@ +# coding: utf-8 + + +def MergeSort(lists): + if len(lists) <= 1: + return lists + num = int(len(lists) / 2) + # 从中间,进行数据的拆分, 递归的返回数据进行迭代排序 + left = MergeSort(lists[:num]) + right = MergeSort(lists[num:]) + print left + print "*" * 20 + print right + print "_" * 20 + return Merge(left, right) + + +def Merge(left, right): + r, l = 0, 0 + result = [] + while l < len(left) and r < len(right): + if left[l] < right[r]: + result.append(left[l]) + l += 1 + else: + result.append(right[r]) + r += 1 + result += right[r:] + result += left[l:] + print 'result:', result + return result + + +if __name__ == "__main__": + print MergeSort([1, 2, 3, 4, 5, 6, 7, 90, 21, 23, 45]) diff --git a/src/py2.x/SortingAlgorithm/QuickSort.py b/src/py2.x/SortingAlgorithm/QuickSort.py new file mode 100644 index 0000000000000000000000000000000000000000..acf81118a072883f42195015126f701c61030c9a --- /dev/null +++ b/src/py2.x/SortingAlgorithm/QuickSort.py @@ -0,0 +1,35 @@ +#!/usr/bin/python +# coding:utf8 + + +def quick_sort(l, start, end): + i = start + j = end + # 结束排序 + if i >= j: + return + # 保存首个数值 + key = l[i] + # 一次排序,i和j的值不断的靠拢,然后最终停止,结束一次排序 + while i < j: + # 和最右边的比较,如果>=key,然后j-1,慢慢的和前一个值比较;如果值key,那么就交换位置 + while i < j and key >= l[i]: + print key, l[i], '*' * 30 + i += 1 + l[j] = l[i] + l[i] = key + # 左边排序 + quick_sort(l, start, j-1) + # 右边排序 + quick_sort(l, i+1, end) + + +if __name__ == "__main__": + l = [5, 1, 9, 3, 2, 7] + quick_sort(l, 0, len(l) - 1) + print l diff --git a/src/py2.x/SortingAlgorithm/SelectionSort.py b/src/py2.x/SortingAlgorithm/SelectionSort.py new file mode 100644 index 0000000000000000000000000000000000000000..98ef64f72deb178f20a2e72bbf05ded4b0e83d1c --- /dev/null +++ b/src/py2.x/SortingAlgorithm/SelectionSort.py @@ -0,0 +1,28 @@ +# coding:utf8 +""" +选择排序和冒泡排序的区别在于: + +选择排序的前提是:找到最大值的位置,最后才进行1次交换 +而冒泡排序:相邻的值进行交换,一共进行n次交换 +""" + + +def selection_sort(l): + length = len(l) - 1 + + while length: + index = length + # 第一个数字,和后面每一个数字进行对比,找出最大值,放到最后!! + for j in range(length): + if l[j] > l[index]: + index = j + l[length], l[index] = l[index], l[length] + print len(l) - length, l + length -= 1 + + +if __name__ == "__main__": + l = [5, 1, 9, 3, 2, 7] + print l + selection_sort(l) + print("result: " + str(l)) \ No newline at end of file diff --git a/src/py2.x/SortingAlgorithm/ShellSort.py b/src/py2.x/SortingAlgorithm/ShellSort.py new file mode 100644 index 0000000000000000000000000000000000000000..9f591a84b937ddfa9b5fda895cf8c79b185020df --- /dev/null +++ b/src/py2.x/SortingAlgorithm/ShellSort.py @@ -0,0 +1,25 @@ +# coding: utf8 + +def insert_sort(l, start, increment): + for i in range(start+increment, len(l), increment): + for j in range(start, len(l[:i]), increment): + if l[i] < l[j]: + l[i], l[j] = l[j], l[i] + print increment, '--',l + return l + +def shell_sort(l, increment): + # 依次进行分层 + while increment: + # 每一层,都进行n次插入排序 + for i in range(0, increment): + insert_sort(l, i, increment) + increment -= 1 + return l + +if __name__ == "__main__": + l = [5, 2, 9, 8, 1, 10, 3, 4, 7] + increment = len(l)/3+1 if len(l)%3 else len(l)/3 + print "开始", l + l = shell_sort(l, increment) + print "结束", l \ No newline at end of file diff --git a/src/py2.x/TreeRecursionIterator.py b/src/py2.x/TreeRecursionIterator.py new file mode 100644 index 0000000000000000000000000000000000000000..ffb4be32f94193105f6b260626d524696cb7932b --- /dev/null +++ b/src/py2.x/TreeRecursionIterator.py @@ -0,0 +1,34 @@ +# coding:utf8 + +class Node(): + def __init__(self, value, left=None, right=None): + self.value = value + self.left = left + self.right = right + +def midRecusion(node): + if node is None: + return + midRecusion(node.left) + print node.value, + midRecusion(node.right) + +def midIterator(node): + stack = [] + while stack or node: + if node is not None: + stack.append(node) + node = node.left + else: + node = stack.pop(-1) + print node.value, + node = node.right + +if __name__ == "__main__": + node = Node("D", Node("B", Node("A"), Node("C")), Node("E", right=Node("G", left=Node("F")))) + + print('\n中序遍历<递归>:') + midRecusion(node) + + print('\n中序遍历<迭代>:') + midIterator(node) \ No newline at end of file diff --git a/src/py2.x/list2iteration.py b/src/py2.x/list2iteration.py new file mode 100644 index 0000000000000000000000000000000000000000..145fd8335c82f4724b24ca399a4e1eae1da53d0f --- /dev/null +++ b/src/py2.x/list2iteration.py @@ -0,0 +1,30 @@ +#!/usr/bin/python +# coding:utf8 +''' +迭代使用的是循环结构。 +递归使用的是选择结构。 +''' + +# 递归求解 +def calculate(l): + if len(l) <= 1: + return l[0] + value = calculate(l[1:]) + return 10**(len(l) - 1) * l[0] + value + + +# 迭代求解 +def calculate2(l): + result = 0 + while len(l) >= 1: + result += 10 ** (len(l)-1) * l[0] + l = l[1:] + return result + + +l1 = [1, 2, 3] +l2 = [4, 5] +sum = 0 +result = calculate(l1) + calculate(l2) +# result = calculate2(l1) + calculate2(l2) +print(result)