MCPcopy Create free account

hub / github.com/Aloxaf/LeetCode-Rust / functions

Functions279 in github.com/Aloxaf/LeetCode-Rust

↓ 56 callersMethodpush
每次都将 x - self.min 存入栈内, 并视情况更新 self.min
src/min_stack.rs:21
↓ 15 callersMethodpop
弹出一个元素, 若弹出元素小于0, 说明该元素比原先的 self.min(old) 大, 并且它是现在的最小元素 即 self.min(now) - self.min(old) = pop
src/min_stack.rs:36
↓ 11 callersMethodget
(&self, key: i32)
src/design_hashmap.rs:90
↓ 9 callersMethodinsert
Inserts a word into the trie. */
src/implement_trie_prefix_tree.rs:14
↓ 7 callersMethodget
Get the value of the index-th node in the linked list. If the index is invalid, return -1. */
src/design_linked_list.rs:45
↓ 5 callersMethodpush
(&mut self, key: i32, val: i32)
src/design_hashmap.rs:52
↓ 4 callersMethodfind
(&self, word: String)
src/implement_trie_prefix_tree.rs:28
↓ 4 callersMethodremove_by_key
(&mut self, key: i32)
src/design_hashmap.rs:94
↓ 4 callersMethodreverse
(x: i32)
src/reverse_integer.rs:3
↓ 3 callersFunctionbacktrack
(b: &mut Bencher)
src/generate_parentheses.rs:78
↓ 3 callersMethodfind_by_key
(&self, key: i32)
src/design_hashmap.rs:78
↓ 3 callersMethodlocate
(&self, index: i32)
src/design_linked_list.rs:64
↓ 2 callersMethodadd_at_index
Add a node of value val before the index-th node in the linked list. If index equals to the length of linked list, the node will be appended to the en
src/design_linked_list.rs:83
↓ 2 callersFunctionbasic_test
(f: fn(Vec<i32>, i32) -> i32)
src/kth_largest_element_in_an_array.rs:23
↓ 2 callersMethodmove_to_output
(&mut self)
src/implement_queue_using_stacks.rs:28
↓ 1 callersMethodflatten
https://leetcode.com/problems/flatten-binary-tree-to-linked-list/discuss/36977/My-short-post-order-traversal-Java-solution-for-share NB, 相形见绌 我佛了
src/flatten_binary_tree_to_linked_list.rs:10
↓ 1 callersMethodpeek
Get the front element. */
src/implement_queue_using_stacks.rs:42
↓ 1 callersMethodpop
(&mut self)
src/implement_queue_using_stacks.rs:36
↓ 1 callersMethodpush
Push element x to the back of queue. */
src/implement_queue_using_stacks.rs:22
↓ 1 callersMethodrotate_right
(head: Option<Box<ListNode>>, mut k: i32)
src/rotate_list.rs:2
Method_is_match
超时的简单粗暴的垃圾算法
src/wildcard_matching.rs:42
Function_unsafe
(b: &mut Bencher)
src/rotate_list.rs:129
Methodadd_at_head
Add a node of value val before the first element of the linked list. After the insertion, the new node will be the first node of the linked list. */
src/design_linked_list.rs:53
Methodadd_at_tail
Append a node of value val to the last element of the linked list. */
src/design_linked_list.rs:58
Methodadd_binary
(a: String, b: String)
src/add_binary.rs:2
Methodadd_digits
https://en.wikipedia.org/wiki/Digital_root#Congruence_formula
src/add_digits.rs:12
Methodadd_digits_recursive
(num: i32)
src/add_digits.rs:2
Methodadd_strings
(num1: S, num2: S)
src/add_strings.rs:2
Methodadd_two_numbers
( l1: Option<Box<ListNode>>, l2: Option<Box<ListNode>>, )
src/add_two_numbers.rs:4
Methodadd_word
Adds a word into the data structure. */
src/add_and_search_word_data_structure_design.rs:22
Methodall_possible_fbt
(n: i32)
src/all_possible_full_binary_trees.rs:8
Methodalphabet_board_path
(target: String)
src/alphabet_board_path.rs:2
Methodasteroid_collision
(asteroids: Vec<i32>)
src/asteroid_collision.rs:2
Methodbacktrack
(ret: &mut Vec<String>, now: String, left: i32, right: i32, n: i32)
src/generate_parentheses.rs:3
Functionbench
(b: &mut Bencher)
src/reverse_string.rs:42
Functionbench
(b: &mut Bencher)
src/implement_trie_prefix_tree.rs:76
Functionbench
(b: &mut Bencher)
src/zigzag_conversion.rs:39
Functionbench_unsafe
(b: &mut Bencher)
src/reverse_string.rs:47
Functionbin
()
src/powx_n.rs:67
Functionbit
()
src/powx_n.rs:74
Functionbuiltin
()
src/same_tree.rs:36
Functionbuiltin
()
src/powx_n.rs:53
Functionbuiltin
(b: &mut Bencher)
src/counting_bits.rs:41
Functionbuiltin
(b: &mut Bencher)
src/length_of_last_word.rs:36
Functionbuiltin
()
src/find_first_and_last_position_of_element_in_sorted_array.rs:60
Functionbuiltin
(b: &mut Bencher)
src/rotate_array.rs:80
Methodc2i
(c: u8)
src/roman_to_integer.rs:3
Methodcalc
(nums: &mut Vec<i32>, op: u8)
src/basic_calculator_ii.rs:13
Methodcalc
(nums: Vec<i32>, ops: Vec<u8>)
src/basic_calculator.rs:4
Methodcalculate
(s: String)
src/basic_calculator_ii.rs:25
Methodcalculate
(s: String)
src/basic_calculator.rs:15
Methodcheck_possibility
(nums: Vec<i32>)
src/non_decreasing_array.rs:2
Methodclimb_stairs
(n: i32)
src/climbing_stairs.rs:2
Functionclourse_number
(b: &mut Bencher)
src/generate_parentheses.rs:83
Methodconvert
(s: String, num_rows: i32)
src/zigzag_conversion.rs:2
Methodconvert_to_title
(mut n: i32)
src/excel_sheet_column_title.rs:2
Methodcore
(node: &mut Node, mut next: Node)
src/flatten_binary_tree_to_linked_list.rs:11
Methodcount_and_say
(n: i32)
src/count_and_say.rs:2
Methodcount_bits
(num: i32)
src/counting_bits.rs:2
Methodcount_bits_builtin
(num: i32)
src/counting_bits.rs:11
Methodcount_primes
(n: i32)
src/count_primes.rs:2
Methodcreate_target_array
(nums: Vec<i32>, index: Vec<i32>)
src/create_target_array_in_the_given_order.rs:2
Functioncustom
(b: &mut Bencher)
src/counting_bits.rs:36
Functioncustom
(b: &mut Bencher)
src/length_of_last_word.rs:31
Functioncustom
()
src/find_first_and_last_position_of_element_in_sorted_array.rs:53
Methoddelete_at_index
Delete the index-th node in the linked list, if the index is valid. */
src/design_linked_list.rs:106
Methoddelete_duplicates
(mut head: Option<Box<ListNode>>)
src/remove_duplicates_from_sorted_list.rs:4
Functiondrain_append
(b: &mut Bencher)
src/rotate_array.rs:72
Methodempty
Returns whether the queue is empty. */
src/implement_queue_using_stacks.rs:48
Methodempty
Returns whether the stack is empty. */
src/implement_stack_using_queues.rs:41
Methodeval_rpn
(tokens: Vec<String>)
src/evaluate_reverse_polish_notation.rs:2
Methodexpand
感觉写得很挫
src/longest_palindromic_substring.rs:3
Methodfind
(trie: &([Option<Box<Trie>>; 26], bool), word: &str)
src/add_and_search_word_data_structure_design.rs:40
Methodfind_kth_largest_pq
(nums: Vec<i32>, k: i32)
src/kth_largest_element_in_an_array.rs:7
Methodfind_kth_largest_sort
(mut nums: Vec<i32>, k: i32)
src/kth_largest_element_in_an_array.rs:2
Methodgenerate
(num_rows: i32)
src/pascals_triangle.rs:2
Methodgenerate_parenthesis
(n: i32)
src/generate_parentheses.rs:2
Methodgenerate_parenthesis_cn
和这个大佬说的dp很像 https://leetcode.com/problems/generate-parentheses/discuss/209410/c%2B%2B-dynamic-programming-(0ms) 设 a[n] = generate_parenthesis(n) a[0]
src/generate_parentheses.rs:27
Methodget_min
(&self)
src/min_stack.rs:54
Methodgroup_anagrams
(strs: Vec<String>)
src/group_anagrams.rs:4
Methodint_to_roman
用了迭代器也好慢啊, 16ms 难道是 String 的处理太慢了?
src/integer_to_roman.rs:4
Methodis_isomorphic
(s: String, t: String)
src/isomorphic_strings.rs:2
Methodis_match
使用泛型以同时接受 String, &str. 测试的时候可以少写一点代码! Yu 的神奇算法, 抓住了 '*' 再多都只需要考虑一个这一点 http://yucoding.blogspot.com/2013/02/leetcode-question-123-wildcard-matching.ht
src/wildcard_matching.rs:5
Methodis_mirror
(t1: Option<Rc<RefCell<TreeNode>>>, t2: Option<Rc<RefCell<TreeNode>>>)
src/symmetric_tree.rs:10
Methodis_palindrome
(s: String)
src/valid_palindrome.rs:2
Methodis_palindrome
(x: i32)
src/palindrome_number.rs:2
Methodis_power_of_two
(n: i32)
src/power_of_two.rs:2
Methodis_same_tree
Best Practice !
src/same_tree.rs:7
Methodis_same_tree2
(p: Option<Rc<RefCell<TreeNode>>>, q: Option<Rc<RefCell<TreeNode>>>)
src/same_tree.rs:15
Methodis_symmetric
(root: Option<Rc<RefCell<TreeNode>>>)
src/symmetric_tree.rs:6
Methodis_symmetric_iter
(root: Option<Rc<RefCell<TreeNode>>>)
src/symmetric_tree.rs:22
Methodis_ugly
(mut num: i32)
src/ugly_number.rs:2
Methodis_valid
(s: String)
src/valid_parentheses.rs:2
Methodis_valid_sudoku
朴实蠢蠢的方法
src/valid_sudoku.rs:3
Methodis_valid_sudoku_hashset
妙啊妙啊 https://leetcode.com/problems/valid-sudoku/discuss/15472/Short%2BSimple-Java-using-Strings 对于 i 行 j 列的数字 c, 将 (None, c, j) (i, c, None) (i / 3, c
src/valid_sudoku.rs:46
Functioniter
()
src/symmetric_tree.rs:63
Methodlargest_number
(nums: Vec<i32>)
src/largest_number.rs:18
Methodlength_of_last_word
(s: String)
src/length_of_last_word.rs:2
Methodlength_of_last_word_builtin
(s: String)
src/length_of_last_word.rs:6
Methodlength_of_longest_substring
(s: String)
src/longest_substring_without_repeating_characters.rs:4
next →1–100 of 279, ranked by callers