leetcode答案-algorithm_questions_and_codes:自己练习的一些算法题

时间:2021-06-30 01:41:16
【文件属性】:
文件名称:leetcode答案-algorithm_questions_and_codes:自己练习的一些算法题
文件大小:116KB
文件格式:ZIP
更新时间:2021-06-30 01:41:16
系统开源 leetcode 答案 算法题目和代码 说明:这些题目都是从leetcode或者其余的算法书上看到的,基本上别人都已有最优解答,我这里只是出于自己学习的需要,重新用python练习一遍,搞懂每个步骤。 001. 用递归函数和栈操作逆序一个栈 说明:一个栈依次压入1、2、3、4、5,那么从栈顶到栈底分别为5、4、3、2、1。将这个栈转置后,从栈顶到栈底为1、2、3、4、5,也就是实现栈中元素的逆序,但是只能用递归函数来实现,不能用其他数据结构。 代码: leetcode001.两数之和 说明:给定一个整数数组和一个目标值,找出数组中和为目标值的两个数。你可以假设每个输入只对应一种答案,且同样的元素不能被重复利用。 代码: leetcode002.两数相加 说明:定两个非空链表来表示两个非负整数。位数按照逆序方式存储,它们的每个节点只存储单个数字。将两数相加返回一个新的链表。你可以假设除了数字 0 之外,这两个数字都不会以零开头。 示例: 输入:(2 -> 4 -> 3) + (5 -> 6 -> 4) 输出:7 -> 0 -> 8 原因:342 + 465 = 807 代码: leetc
【文件预览】:
algorithm_questions_and_codes-master
----leetcode016()
--------test_3Sum Closest.py(2KB)
----leetcode039()
--------test_Combination_Sum.py(2KB)
----leetcode045()
--------test_Jump_Game_II.py(2KB)
----leetcode012()
--------test_Integer_to_Roman.py(3KB)
----leetcode033()
--------test_Search_in_Rotated_Sorted_Array.py(3KB)
----leetcode061()
--------test_Rotate_List.py(3KB)
----leetcode042()
--------test_Trapping_Rain_Water.py(1KB)
----leetcode028()
--------test_Implement_strStr.py(501B)
----leetcode032()
--------test_Longest_Valid_Parentheses.py(2KB)
----leetcode025()
--------test_Reverse_Nodes_in_k_Group.py(3KB)
----leetcode048()
--------test_Rotate_Image.py(2KB)
----leetcode052()
--------test_N_queens_II.py(3KB)
----leetcode002()
--------test_Add_Two_Numbers_leetcode.py(2KB)
----leetcode417()
--------test_Pacific_Atlantic_Water_Flow_new.py(6KB)
----leetcode121()
--------test_Best_Time_to_Buy_and_Sell_Stock.py(1KB)
----leetcode046()
--------test_Permutations.py(2KB)
----leetcode003()
--------test_Longest_Substring_Without_Repeating_Characters.py(1KB)
----leetcode010()
--------test_Regular_Expression_Matching_dp.py(2KB)
--------test_Regular_Expression_Matching.py(4KB)
----leetcode019()
--------test_Remove_Nth_Node_From_End_of_List.py(2KB)
----leetcode026()
--------test_Remove_Duplicates_from_Sorted_Array.py(2KB)
----leetcode034()
--------test_Find_First_and_Last_Position_of_Element_in_Sorted_Array.py(3KB)
----leetcode011()
--------test_Container_With_Most_Water.py(1KB)
----leetcode064()
--------test_Minimum_Path_Sum.py(2KB)
----leetcode008()
--------test_String_to_Integer.py(4KB)
----leetcode058()
--------test_Length_of_Last_Word.py(1KB)
----leetcode029()
--------test_Divide_Two_Integers.py(2KB)
----leetcode023()
--------test_Merge_k_Sorted_Lists.py(2KB)
----leetcode015()
--------test_three_sum.py(3KB)
----leetcode022()
--------test_Generate_Parentheses.py(1KB)
----leetcode001()
--------test_two_sum.py(1KB)
----leetcode004()
--------test_Median_of_Two_Sorted_Arrays.py(11KB)
----leetcode021()
--------test_Merge_Two_Sorted_Lists.py(2KB)
----leetcode027()
--------test_Remove_Element.py(1KB)
----leetcode050()
--------test_Pow(x, n).py(1KB)
----leetcode047()
--------test_Permutations_II.py(1KB)
----leetcode035()
--------test_Search_Insert_Position.py(2KB)
----leetcode403()
--------test_Frog_Jump.py(4KB)
----leetcode037()
--------test_Sudoku_Solver_3.py(7KB)
----leetcode057()
--------test_Insert_Interval.py(4KB)
----leetcode041()
--------test_First_Missing_Positive.py(2KB)
----README.md(30KB)
----leetcode014()
--------test_Longest_Common_Prefix.py(1KB)
----leetcode020()
--------test_Valid_Parentheses.py(2KB)
----leetcode007()
--------test_Reverse_Integer.py(959B)
----leetcode030()
--------test_Substring_with_Concatenation_of_All_Words.py(3KB)
----leetcode009()
--------test_Palindrome_Number.py(1004B)
----leetcode054()
--------test_Spiral_Matrix.py(2KB)
----leetcode051()
--------test_N_queens_I.py(8KB)
--------test_N_queens_II.py(4KB)
----leetcode036()
--------test_Valid_Sudoku.py(4KB)
----leetcode044()
--------test_Wildcard_Matching2.py(4KB)
--------test_Wildcard_Matching.py(3KB)
----leetcode005()
--------test_Longest_Palindromic_Substring.py(2KB)
----leetcode059()
--------test_Spiral_Matrix_II.py(2KB)
----leetcode053()
--------test_Maximum_Subarray.py(2KB)
----001()
--------stack_define.py(569B)
--------stack_test.py(467B)
--------file_function.py(641B)
----sort()
--------Radix_Sort.py(939B)
--------Heap_Sort.py(1KB)
--------Merge_Sort.py(835B)
--------Selection_sort.py(602B)
--------Bubble_Sort.py(821B)
--------Shell_Sort.py(898B)
--------Quick_Sort.py(820B)
--------Insertion_Sort.py(565B)
----leetcode018()
--------test_4Sum.py(3KB)
----leetcode043()
--------test_Multiply_Strings.py(2KB)
----leetcode060()
--------test_Permutation_Sequence.py(3KB)
----leetcode070()
--------test_Climbing_Stairs.py(1KB)
----leetcode122()
--------test_Best_Time_to_Buy_and_Sell_Stock_II.py(2KB)
----leetcode056()
--------test_Merge_Intervals.py(2KB)
----leetcode040()
--------test_Combination_Sum_II.py(2KB)
----leetcode024()
--------test_Swap_Nodes_in_Pairs.py(2KB)
----leetcode062()
--------test_Unique_Paths.py(2KB)
----leetcode013()
--------test_Roman_to_Integer.py(2KB)
----leetcode049()
--------test_Group_Anagrams_2.py(1KB)
----leetcode063()
--------test_Unique_Paths_II.py(3KB)
----leetcode980()
--------test_Unique_Paths_III.py(7KB)
----leetcode017()
--------test_Letter_Combinations_of_a_Phone_Number.py(2KB)
----leetcode006()
--------test_ZigZag_Conversion.py(2KB)
----leetcode055()
--------test_Jump_Game_new.py(3KB)
----leetcode038()
--------test_Count_and_Say.py(2KB)
----leetcode031()
--------test_Next_Permutation.py(2KB)

网友评论