文件名称:leetcode答案-LeetCodeSolution:这是LeetCode网站问题的解决方案集
文件大小:11KB
文件格式:ZIP
更新时间:2024-07-19 18:49:09
系统开源
leetcode 答案 LeetCodeSolution This is the solutions set of the LeetCode Website's problems. Some Information Language :Java Website url : Why to Do : Everyday Code is interesting Notes Climbing Stairs 一开始用传统的递归解题,结果TL了。看了下Dscuss,搜索了一下,发现这道居然就是典型的动态规划题,用哈希把子问题的答案记录了就能节省大量的运行时间。 Linked List Cycle 判断链表是否有环。通过快慢节点可以简单实现。 Unique Binary Search Trees 本题参考了 里面的*How Many Binary Trees Are There?*章节。 The first few terms: C(0) = 1 C(1) = C(0)C(0) = 1 C(2) = C(0)C(1) + C(1)C(0) = 2 C(3) = C(0)C(2) + C(1)C(1)
【文件预览】:
LeetCodeSolution-master
----BinaryTreePostorderTraversal.java(609B)
----SingleNumber.java(393B)
----UniqueBinarySearchTrees.java(359B)
----MaximumDepthOfBinaryTree.java(412B)
----RomanToInteger.java(614B)
----TwoSum.java(790B)
----BalancedBinaryTree.java(606B)
----MaximumSubarray.java(233B)
----SingleNumberII.java(346B)
----IntegerToRoman.java(709B)
----BinaryTreeInorderTraversal.java(614B)
----ReverseInteger.java(663B)
----LongestConsecutiveSequence.java(783B)
----ClimbingStairs.java(285B)
----ReverseWordsInAString.java(460B)
----SameTree.java(535B)
----PopulatingNextRightPointersInEachNode.java(540B)
----RemoveElement.java(321B)
----BestTimetoBuyandSellStockII.java(285B)
----README.md(1KB)
----SpiralMatrix.java(1KB)
----SearchInsertPosition.java(339B)
----Remove DuplicatesFromSortedList.java(528B)
----LinkedListCycle.java(558B)
----BinaryTreePreorderTraversal.java(604B)