Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit db5d900

Browse files
Documentation fine-tuning
1 parent 5fa2910 commit db5d900

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

‎src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
//! The usage is very simple. These are the primary components:
2727
//! - [`prelude`]
2828
//! - [`utils::TreeNode`]
29+
//! - [`utils::ListNode`]
30+
//! - [`utils::symmetric_tree`]
2931
//!
3032
//!
3133
//! Additionally, via the support of the cargo make library you can comfortably run your LeetCode

‎src/macros/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ macro_rules! tree {
9595
/// Arm 1:
9696
/// - Takes the value as an argument.
9797
/// - Equivalent of doing `TreeNode::new()`.
98+
///
9899
/// Arm 2:
99100
/// - Takes the value as an argument.
100101
/// - Also takes a sequence of left and right node values at the same time (which means they're
@@ -174,8 +175,6 @@ macro_rules! tree {
174175
/// };
175176
/// assert_eq!(node, symmetric_tree!(1, 2, 3, 4));
176177
/// ```
177-
/// Now you have a tree that branches all the way through the right side without having anything on
178-
/// the left.
179178
#[macro_export]
180179
macro_rules! symmetric_tree {
181180
($val:expr) => {
@@ -204,6 +203,7 @@ macro_rules! symmetric_tree {
204203
/// Arm 1:
205204
/// - Takes the value as an argument.
206205
/// - Equivalent of doing `TreeNode::new()`.
206+
///
207207
/// Arm 2:
208208
/// - Takes the value as an argument.
209209
/// - Also takes a sequence of left only node values as an argument (and builds the `TreeNode`
@@ -261,6 +261,7 @@ macro_rules! left_tree {
261261
/// Arm 1:
262262
/// - Takes the value as an argument.
263263
/// - Equivalent of doing `TreeNode::new()`.
264+
///
264265
/// Arm 2:
265266
/// - Takes the value as an argument.
266267
/// - Also takes a sequence of right only node values as an argument (and builds the `TreeNode`

‎src/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ use crate::error::Error;
33
/// The crate level used result type.
44
pub type Result<T> = core::result::Result<T, Error>;
55

6-
/// Common DSA Re-exports
6+
/// Common DSA Re-exports.
77
pub use std::collections::{HashMap, HashSet, VecDeque};

‎src/utils/linked_lists.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,17 @@ use serde::{Deserialize, Serialize};
3636
/// ## Big O
3737
///
3838
/// Peeking/modifying the first element -> O(1)
39+
///
3940
/// Peeking/modifying the last element -> O(n)
41+
///
4042
/// Removing the first element -> O(1)
43+
///
4144
/// Removing any next element -> O(n)
45+
///
4246
/// Adding a new element at the end -> O(n)
47+
///
4348
/// Adding a new element at the start -> O(1)
49+
///
4450
/// Searching -> O(n)
4551
#[derive(PartialEq, Eq, Clone, Debug)]
4652
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]

‎src/utils/trees.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ use std::{cell::RefCell, rc::Rc};
162162
/// None None None None
163163
/// ```
164164
///
165-
/// NOTE:
166-
/// If root->right.val != root->left.val then the tree wouldn't be balanced
167-
/// The same is the case if root->left->left.val != root->right->right.val.
165+
/// NOTE: If root->right.val != root->left.val then the tree wouldn't be balanced. The same is the
166+
/// case if root->left->left.val != root->right->right.val.
168167
///
169168
/// ## Big O
170169
///
171170
/// Traversal (postorder, preorder and inorder) -> O(n)
171+
///
172172
/// Insertion at the start (above the old root) -> O(1)
173173
///
174174
/// Any other insertion:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /