Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Jack-Cherish/LeetCode
/ functions
Functions
82 in github.com/Jack-Cherish/LeetCode
⨍
Functions
82
◇
Types & classes
65
↓ 16 callers
Method
top
Stack/Easy/155.Min Stack/Min Stack.cpp:20
↓ 11 callers
Method
empty
Returns whether the stack is empty. */
Stack/Easy/225.Implement Stack using Queues/Implement Stack using Queues.cpp:31
↓ 11 callers
Method
pop
Stack/Easy/155.Min Stack/Min Stack.cpp:13
↓ 7 callers
Method
push
Stack/Easy/155.Min Stack/Min Stack.cpp:7
↓ 5 callers
Method
top
Get the top element. */
Stack/Easy/225.Implement Stack using Queues/Implement Stack using Queues.cpp:26
↓ 4 callers
Method
pop
Removes the element on top of the stack and returns that element. */
Stack/Easy/225.Implement Stack using Queues/Implement Stack using Queues.cpp:19
↓ 2 callers
Function
reverseList
* Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */
Linked List/Easy/234.Palindrome Linked List/Palindrome Linked List.c:8
↓ 1 callers
Method
empty
Returns whether the queue is empty. */
Stack/Easy/232.Implement Queue using Stacks/Implement Queue using Stacks.cpp:28
↓ 1 callers
Method
find
(self, root, sum, ls, res)
Tree/Medium/113.Path Sum II/Path Sum II.py:21
↓ 1 callers
Method
pop
Removes the element from in front of queue and returns that element. */
Stack/Easy/232.Implement Queue using Stacks/Implement Queue using Stacks.cpp:10
↓ 1 callers
Method
push
Push element x onto stack. */
Stack/Easy/225.Implement Stack using Queues/Implement Stack using Queues.cpp:10
↓ 1 callers
Method
push
Push element x to the back of queue. */
Stack/Easy/232.Implement Queue using Stacks/Implement Queue using Stacks.cpp:6
Method
MyStack
Initialize your data structure here. */
Stack/Easy/225.Implement Stack using Queues/Implement Stack using Queues.cpp:4
Method
addBinary
:type a: str :type b: str :rtype: str
String/Easy/67.Add Binary/Add Binary.py:2
Method
addBinary
String/Easy/67.Add Binary/67.Add Binary.cpp:3
Method
checkRecord
:type s: str :rtype: bool
String/Easy/551. Student Attendance Record I/Student Attendance Record I.py:2
Method
countAndSay
:type n: int :rtype: str
String/Easy/38.Count and Say/Count and Say.py:3
Method
countSegments
String/Easy/434.Number of Segments in a String/Number of Segments in a String.cpp:13
Method
countSegments
:type s: str :rtype: int
String/Easy/434.Number of Segments in a String/Number of Segments in a String.py:2
Function
deleteDuplicates
* Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */
Linked List/Easy/83.Remove Duplicates from Sorted List/Remove Duplicates from Sorted List.c:8
Method
deleteDuplicates
Linked List/Easy/83.Remove Duplicates from Sorted List/Remove Duplicates from Sorted List.cpp:11
Method
deleteDuplicates
:type head: ListNode :rtype: ListNode
Linked List/Easy/83.Remove Duplicates from Sorted List/Remove Duplicates from Sorted List.py:8
Function
deleteNode
* Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */
Linked List/Easy/237.Delete Node in a Linked List/Delete Node in a Linked List.c:8
Method
deleteNode
:type node: ListNode :rtype: void Do not return anything, modify node in-place instead.
Linked List/Easy/237.Delete Node in a Linked List/Delete Node in a Linked List.py:8
Method
depth
(node)
Tree/Easy/543.Diameter of Binary Tree/Diameter of Binary Tree.py:15
Method
depth
Tree/Easy/543.Diameter of Binary Tree/Diameter of Binary Tree.cpp:19
Method
detectCapitalUse
:type word: str :rtype: bool
String/Easy/520.Detect Capital/Detect Capital.py:2
Method
detectCapitalUse
String/Easy/520.Detect Capital/Detect Capital.cpp:3
Method
diameterOfBinaryTree
:type root: TreeNode :rtype: int
Tree/Easy/543.Diameter of Binary Tree/Diameter of Binary Tree.py:9
Method
diameterOfBinaryTree
Tree/Easy/543.Diameter of Binary Tree/Diameter of Binary Tree.cpp:13
Method
evalRPN
Stack/Medium/150.Evaluate Reverse Polish Notation/Evaluate Reverse Polish Notation.cpp:3
Method
findLUSlength
:type a: str :type b: str :rtype: int
String/Easy/521.Longest Uncommon Subsequence I/Longest Uncommon Subsequence I.py:2
Method
findMode
Tree/Easy/501.Find Mode in Binary Search Tree/Find Mode in Binary Search Tree.cpp:12
Method
findMode
:type root: TreeNode :rtype: List[int]
Tree/Easy/501.Find Mode in Binary Search Tree/Find Mode in Binary Search Tree.py:9
Function
getIntersectionNode
* Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */
Linked List/Easy/160.Intersection of Two Linked Lists/Intersection of Two Linked Lists.c:8
Method
getIntersectionNode
:type head1, head1: ListNode :rtype: ListNode
Linked List/Easy/160.Intersection of Two Linked Lists/Intersection of Two Linked Lists.py:8
Method
getIntersectionNode
Linked List/Easy/160.Intersection of Two Linked Lists/Intersection of Two Linked Lists.cpp:11
Method
getLength
Linked List/Easy/160.Intersection of Two Linked Lists/Intersection of Two Linked Lists.cpp:37
Method
getMin
Stack/Easy/155.Min Stack/Min Stack.cpp:29
Function
hasCycle
* Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */
Linked List/Easy/141.Linked List Cycle/Linked List Cycle.c:8
Method
hasCycle
:type head: ListNode :rtype: bool
Linked List/Easy/141.Linked List Cycle/Linked List Cycle.py:8
Method
hasCycle
Linked List/Easy/141.Linked List Cycle/Linked List Cycle.cpp:11
Method
hasPathSum
:type root: TreeNode :type sum: int :rtype: bool
Tree/Easy/112.Path Sum/Path Sum-2.py:9
Method
hasPathSum
:type root: TreeNode :type sum: int :rtype: bool
Tree/Easy/112.Path Sum/Path Sum-1.py:9
Method
hasPathSum
Tree/Easy/112.Path Sum/Path Sum.cpp:12
Function
isPalindrome
Linked List/Easy/234.Palindrome Linked List/Palindrome Linked List.c:22
Method
isPalindrome
Linked List/Easy/234.Palindrome Linked List/Palindrome Linked List.cpp:11
Method
isPalindrome
:type head: ListNode :rtype: bool
Linked List/Easy/234.Palindrome Linked List/Palindrome.py:8
Method
isValid
Stack/Easy/20.Valid Parentheses/Valid Parentheses.cpp:3
Method
judgeCircle
:type moves: str :rtype: bool
String/Easy/657.Judge Route Circle/Judge Route Circle.py:2
Method
lcp
(self, str1, str2)
String/Easy/14.Longest Common Prefix/Longest Common Prefix.py:19
Method
longestCommonPrefix
:type strs: List[str] :rtype: str
String/Easy/14.Longest Common Prefix/Longest Common Prefix.py:3
Method
lowestCommonAncestor
:type root: TreeNode :type p: TreeNode :type q: TreeNode :rtype: TreeNode
Tree/Easy/235.Lowest Common Ancestor of a Binary Search Tree/Lowest Common Ancestor of a Binary Search Tree-1.py:9
Method
lowestCommonAncestor
Tree/Easy/235.Lowest Common Ancestor of a Binary Search Tree/Lowest Common Ancestor of a Binary Search Tree.cpp:12
Method
lowestCommonAncestor
:type root: TreeNode :type p: TreeNode :type q: TreeNode :rtype: TreeNode
Tree/Easy/235.Lowest Common Ancestor of a Binary Search Tree/Lowest Common Ancestor of a Binary Search Tree-2.py:9
Function
mergeTwoLists
* Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */
Linked List/Easy/21.Merge Two Sorted Lists/Merge Two Sorted Lists.c:8
Method
mergeTwoLists
Linked List/Easy/21.Merge Two Sorted Lists/Merge Two Sorted Lists.cpp:11
Method
mergeTwoLists
:type l1: ListNode :type l2: ListNode :rtype: ListNode
Linked List/Easy/21.Merge Two Sorted Lists/Merge Two Sorted Lists.py:8
Method
minDepth
:type root: TreeNode :rtype: int
Tree/Easy/111.Minimum Depth of Binary Tree/Minimum Depth of Binary Tree-2.py:9
Method
minDepth
Tree/Easy/111.Minimum Depth of Binary Tree/Minimum Depth of Binary Tree.cpp:12
Method
minDepth
:type root: TreeNode :rtype: int
Tree/Easy/111.Minimum Depth of Binary Tree/Minimum Depth of Binary Tree-1.py:9
Method
nextGreaterElement
Stack/Easy/496.Next Greater Element I/Next Greater Element I.cpp:3
Method
pathSum
:type root: TreeNode :type sum: int :rtype: List[List[int]]
Tree/Medium/113.Path Sum II/Path Sum II.py:9
Method
peek
Get the front element. */
Stack/Easy/232.Implement Queue using Stacks/Implement Queue using Stacks.cpp:17
Function
removeElements
* Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */
Linked List/Easy/203.Remove Linked List Elements/Remove Linked List Elements.c:8
Method
removeElements
Linked List/Easy/203.Remove Linked List Elements/Remove Linked List Elements.cpp:11
Function
reverseList
* Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */
Linked List/Easy/206.Reverse Linked List/Reverse Linked List-recursively.c:8
Function
reverseList
* Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */
Linked List/Easy/206.Reverse Linked List/Reverse Linked List-iteratively.c:8
Method
reverseList
Linked List/Easy/234.Palindrome Linked List/Palindrome Linked List.cpp:31
Method
reverseList
:type head: ListNode :rtype: ListNode
Linked List/Easy/206.Reverse Linked List/Reverse Linked List.py:8
Method
reverseStr
String/Easy/541.Reverse String II/Reverse String II.cpp:3
Method
reverseStr
:type s: str :type k: int :rtype: str
String/Easy/541.Reverse String II/Reverse String II.py:2
Method
reverseString
String/Easy/344.Reverse String/Reverse String.cpp:3
Method
reverseString
:type s: str :rtype: str
String/Easy/344.Reverse String/Reverse String.py:2
Method
reverseWords
:type s: str :rtype: str
String/Easy/557.Reverse Words in a String III/Reverse Words in a String III.py:2
Method
reverseWords
String/Easy/557.Reverse Words in a String III/Reverse Words in a String III.cpp:3
Method
romanToInt
:type s: str :rtype: int
String/Easy/13.Roman to Integer/Roman to Integer.py:2
Function
rotateRight
* Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */
Linked List/Medium/61.Rotate List/Rotate List.c:8
Method
rotateRight
Linked List/Medium/61.Rotate List/Rotate List.cpp:11
Method
rotateRight
:type head: ListNode :type k: int :rtype: ListNode
Linked List/Medium/61.Rotate List/Rotate List.py:9
Method
tree2str
Tree/Easy/606.Construct String from Binary Tree/Construct String from Binary Tree.cpp:12
Method
tree2str
:type t: TreeNode :rtype: str
Tree/Easy/606.Construct String from Binary Tree/Construct String from Binary Tree.py:9