Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/HuberTRoy/leetCode
/ functions
Functions
332 in github.com/HuberTRoy/leetCode
⨍
Functions
332
◇
Types & classes
177
↓ 56 callers
Method
get
:type key: int :rtype: int
Design/LRUCache.py:65
↓ 51 callers
Method
pop
(self)
Stack/GetMinStack.py:41
↓ 29 callers
Method
push
(self, value)
Stack/GetMinStack.py:38
↓ 17 callers
Function
helper
(x, y, result=0)
Array/FootballFans.py:61
↓ 10 callers
Method
reverse
:type x: int :rtype: int
String/ReverseInteger.py:33
↓ 7 callers
Method
add
(self, value)
Tree/BinarySearchTree.py:36
↓ 7 callers
Method
split
(l)
Sorted/SortList.py:160
↓ 5 callers
Method
empty
(self)
Stack/GetMinStack.py:50
↓ 5 callers
Method
push
(self, value)
Stack/ImplementQueueUsingStack.py:42
↓ 4 callers
Function
checkStop
(matrix, x, y)
Array/SpiralMatrix.py:39
↓ 4 callers
Function
construct
(treeDict)
Tree/serializeAndDeserialize.py:88
↓ 4 callers
Method
get_min
返回栈顶但不压出。
Stack/GetMinStack.py:79
↓ 4 callers
Method
get_top
查看栈顶的数据但不压出。
Stack/GetMinStack.py:44
↓ 4 callers
Method
pop
(self)
Stack/ImplementQueueUsingStack.py:48
↓ 4 callers
Function
split
(arr)
Array/KthLargestElementInAnArray.js:37
↓ 3 callers
Method
setBreakable
(self, enable)
Tree/Trie.py:40
↓ 2 callers
Method
_put
{ key: {'value': value, 'weight': self.current_cache_number} } {
Design/LRUCache.py:114
↓ 2 callers
Method
_replace
replace the existed key to new value and weight.
Design/LRUCache.py:139
↓ 2 callers
Method
addNext
(self, nextNode)
Tree/Trie.py:37
↓ 2 callers
Method
bi_search
(self, nums, target, lo, hi)
Array/SearchInRotatedSortedArrayII.py:68
↓ 2 callers
Method
bi_search
(self, nums, target, lo, hi)
Array/SearchInRotatedSortedArray.py:80
↓ 2 callers
Method
construct
(self, constructDict)
Tree/serializeAndDeserialize.py:77
↓ 2 callers
Function
getKNodes
(head)
Array/ReverseNodesInk-Group.js:22
↓ 2 callers
Method
getRest
(self, l1, l2, rest=0)
Array/AddTwoNumbers.py:73
↓ 2 callers
Function
judgeEqual
(cards, target)
DP/PickCards.py:88
↓ 2 callers
Method
remove
Removes a value from the set. Returns true if the set contained the specified element. :type val: int :rtype: bool
Design/InsertDeleteGetRandomO(1).py:95
↓ 2 callers
Function
reverse
(nodes)
Array/ReverseNodesInk-Group.js:35
↓ 2 callers
Method
right
(self, matrix, x, y, result, stop)
Array/SpiralMatrix.py:59
↓ 2 callers
Method
search
(self, value)
Tree/BinarySearchTree.py:63
↓ 2 callers
Method
serialize
(self)
Tree/serializeAndDeserialize.py:80
↓ 1 callers
Method
__init__
这里用实例对象。
Stack/GetMinStack.py:28
↓ 1 callers
Method
_addTwoNumbers
(self, l1, l2)
Array/AddTowNumbersII.py:76
↓ 1 callers
Method
_add_exist_key_weight
(self, key)
Design/LRUCache.py:82
↓ 1 callers
Method
_decomposeAndMerge
(self, unsorted_list_A, unsorted_list_B, key)
Array/KthLargestElementInAnArray.py:103
↓ 1 callers
Method
_get
(self, key)
Design/LRUCache.py:72
↓ 1 callers
Method
_getMiddle
返回快排所需的基准点, 左右中中间选择一个。 若不足3位,选左。
Array/KthLargestElementInAnArray.py:68
↓ 1 callers
Method
_middlePrint
(self, root, result)
Tree/BinarySearchTree.py:100
↓ 1 callers
Method
_put_and_remove
(self, key, value)
Design/LRUCache.py:129
↓ 1 callers
Method
_search
(self, root, word)
Tree/Trie.py:77
↓ 1 callers
Method
_search
(self, root, value)
Tree/BinarySearchTree.py:67
↓ 1 callers
Method
_serialize
(self)
Tree/serializeAndDeserialize.py:73
↓ 1 callers
Method
_startWith
(self, root, prefix)
Tree/Trie.py:102
↓ 1 callers
Method
_suffPrint
(self, root, result)
Tree/BinarySearchTree.py:116
↓ 1 callers
Method
_twoSum
:type nums: List[int] :type target: int :rtype: List[int]
Array/two_sum.py:58
↓ 1 callers
Method
binarySearch
(self, rawList, target, index=0)
Array/Search2DMatrix.py:55
↓ 1 callers
Method
binarySearch2
(self, rawList, target)
Array/Search2DMatrix.py:81
↓ 1 callers
Method
check_cache_capacity
True is reached capacity. False is not.
Design/LRUCache.py:154
↓ 1 callers
Method
coinChange
:type coins: List[int] :type amount: int :rtype: int
DP/CoinChange.py:53
↓ 1 callers
Function
combined
(list1, list2)
Sorted/sotred.py:70
↓ 1 callers
Function
deserialize
(string)
Tree/serializeAndDeserialize.py:85
↓ 1 callers
Method
down
(self, matrix, x ,y, result, stop)
Array/SpiralMatrix.py:75
↓ 1 callers
Function
fastSort
(shuffledList)
Sorted/sotred.py:125
↓ 1 callers
Method
find_bi
(self, nums, target)
Array/SlidingWindowMaximum.py:47
↓ 1 callers
Method
find_data
(self, root: TreeNode)
Tree/KthSmallestElementInABST.py:61
↓ 1 callers
Method
find_left
(self, nums, target)
Array/FindFirstAndLastPositionOfElementInSortedArray.py:97
↓ 1 callers
Method
find_right
(self, nums, target)
Array/FindFirstAndLastPositionOfElementInSortedArray.py:81
↓ 1 callers
Method
find_rotate
(self, nums)
Array/SearchInRotatedSortedArrayII.py:47
↓ 1 callers
Method
find_rotate
(self, nums)
Array/FindMinimumInRotatedSortedArrayII.py:34
↓ 1 callers
Method
find_rotate
(self, nums)
Array/FindMinimumInRotatedSortedArray.py:31
↓ 1 callers
Method
find_rotate
(self, nums)
Array/SearchInRotatedSortedArray.py:64
↓ 1 callers
Method
getEqualNodes
(self, l1, l2)
Array/AddTowNumbersII.py:89
↓ 1 callers
Function
getFootballFans
[[0, 0, 0].....] 从 0,0 开始,如果遇到1则进入递归: 递归结束条件: 四周都是 0或边界。 结束时将搜索到的人数添加。 未结束时根据四周的情况进入相同的递归。
Array/FootballFans.py:44
↓ 1 callers
Method
getRest
(self, l1, l2, rest=0)
Array/AddTowNumbersII.py:122
↓ 1 callers
Method
get_init_nodes
(self)
Tree/CompleteBinaryTreeInserter.py:81
↓ 1 callers
Method
get_up_left
(self, x, y)
Array/MinimumPathSum.py:32
↓ 1 callers
Function
helper
(stacks)
Stack/ReverseAStackByRecursive.py:15
↓ 1 callers
Method
insert
:type v: int :rtype: int
Tree/CompleteBinaryTreeInserter.py:103
↓ 1 callers
Method
insert
:type intervals: List[Interval] :type newInterval: Interval :rtype: List[Interval]
Array/InsertInterval.py:38
↓ 1 callers
Method
isInterleave
:type s1: str :type s2: str :type s3: str :rtype: bool
DP/InterleavingString.py:133
↓ 1 callers
Method
left
(self, matrix, x, y, result, stop)
Array/SpiralMatrix.py:90
↓ 1 callers
Method
letter_all_capital_or_lower
(self, word)
String/DetectCapital.py:63
↓ 1 callers
Method
letter_all_lower
(self, word)
String/DetectCapital.py:81
↓ 1 callers
Method
longestPalindrome
(self, s)
String/LongestPalindromicSubstrings.py:46
↓ 1 callers
Method
makeATrieNodes
(self, word)
Tree/Trie.py:115
↓ 1 callers
Method
makeAround
(self, x, y)
Array/SurroundedRegions.py:58
↓ 1 callers
Function
makeAroundXY
(x, y)
Array/FootballFans.py:33
↓ 1 callers
Method
makeAroundXY
(self, x, y)
Array/MaxAreaOfIsland.py:32
↓ 1 callers
Method
makeCombinations
(self, split_list)
String/LongestPalindromicSubstrings.py:81
↓ 1 callers
Method
makeXY
(self, x, y)
Array/NumberOfIslands.py:33
↓ 1 callers
Function
maxALEminB
思路与前一致,前一版的主要瓶颈在于有太多重复的数据,若可以将这些重复的数据统计到一起,可以极大的减少对比次数。 [[3], [2], [1]] 现在变为 [[(3, 1)], [(2, 1)], [(1, 1)]]
DP/MaxASubarrayLessThanMinBSubarray.py:83
↓ 1 callers
Function
maxCardsScope
(cards)
DP/PickCards.py:63
↓ 1 callers
Function
merge
(arr, arr2)
Array/KthLargestElementInAnArray.js:45
↓ 1 callers
Function
mergeArray
这个测试数据的结构是我自己写的,所以第一步是打散数组。 1. 根据第一个字符出现的位置进行排序。 2. 迭代,记录i的头,记录i的末尾,末尾与下一个i的头做比较,若前者记录的大或相等则末尾替换为两者中较大的一个。 3. 不大的情况添加
Array/MergeArray.py:63
↓ 1 callers
Method
middlePrint
(self)
Tree/BinarySearchTree.py:109
↓ 1 callers
Method
quickSort
每次都选一个基准点,大的放在右边,小的放在左边,等于的随便归到一个地方,不断拆分拆分。 这里直接选用[0],当然这种情况下往往会发生不理想的情况, 不理想的情况表示每次恰好都是最小或最大,这样的结果会直接导致算法变为O(n^2
Array/KthLargestElementInAnArray.py:46
↓ 1 callers
Function
reduce
(splitedList)
Sorted/sotred.py:99
↓ 1 callers
Function
reverseStack
(stacks)
Stack/ReverseAStackByRecursive.py:12
↓ 1 callers
Method
search
DFS/WordSearch.py:206
↓ 1 callers
Function
sort
(arr)
Array/KthLargestElementInAnArray.js:8
↓ 1 callers
Function
sort2
(arr)
Array/KthLargestElementInAnArray.js:76
↓ 1 callers
Method
suffPrint
(self)
Tree/BinarySearchTree.py:125
↓ 1 callers
Method
threeSum
:type nums: List[int] :rtype: List[List[int]]
Array/ThreeSum.py:45
↓ 1 callers
Method
up
(self, matrix, x, y, result, stop)
Array/SpiralMatrix.py:105
Method
__eq__
(self, other)
Tree/Trie.py:43
Method
__init__
initialize your data structure here.
Heap/FindMedianFromDataStream.py:115
Method
__init__
(self, value, nextNode=None)
Tree/Trie.py:29
Method
__init__
Initialize your data structure here.
Tree/Trie.py:50
Method
__init__
:type root: TreeNode
Tree/CompleteBinaryTreeInserter.py:71
Method
__init__
(self, val, left=None, right=None)
Tree/serializeAndDeserialize.py:53
Method
__init__
(self , val, left=None, right=None)
Tree/BinarySearchTree.py:14
next →
1–100 of 332, ranked by callers