Skip to content
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
815d8a7
.
dragoljub-djuric Feb 26, 2024
c256be9
Merge branch 'main' into EXC-1384-add-stable-b-tree-set-in-stable-str…
dragoljub-djuric Mar 14, 2024
86ddec1
.
dragoljub-djuric Mar 19, 2024
948393f
fix test
dragoljub-djuric Mar 19, 2024
3484ff6
clippy
dragoljub-djuric Mar 19, 2024
2e1f509
refactor
dragoljub-djuric Mar 19, 2024
e0518ed
Merge branch 'main' into EXC-1384-add-stable-b-tree-set-in-stable-str…
dragoljub-djuric Apr 23, 2025
e245d9b
.
dragoljub-djuric Apr 25, 2025
6ff4a33
.
dragoljub-djuric Apr 25, 2025
dde8267
.
dragoljub-djuric Apr 25, 2025
9615d6c
.
dragoljub-djuric Apr 25, 2025
e3d31cb
.
dragoljub-djuric Apr 25, 2025
9386c45
.
dragoljub-djuric Apr 25, 2025
53fa85e
.
dragoljub-djuric Apr 25, 2025
a169923
.
dragoljub-djuric Apr 25, 2025
198e1e8
.
dragoljub-djuric Apr 25, 2025
8e9ae09
.
dragoljub-djuric Apr 28, 2025
cb258ea
Merge branch 'main' into EXC-1384-add-stable-b-tree-set-in-stable-str…
dragoljub-djuric Apr 28, 2025
58332f0
.
dragoljub-djuric Apr 28, 2025
d720fa2
.
dragoljub-djuric Apr 28, 2025
17534a1
.
dragoljub-djuric Apr 28, 2025
5cf86f5
.
dragoljub-djuric Apr 28, 2025
2393c00
.
dragoljub-djuric Apr 28, 2025
308e1d9
.
dragoljub-djuric Apr 28, 2025
7b55e60
.
dragoljub-djuric Apr 29, 2025
481741e
Update src/btreeset.rs
dragoljub-djuric Apr 29, 2025
147d88c
.
dragoljub-djuric Apr 29, 2025
176192e
Revert canbench_results.yml change.
dragoljub-djuric Apr 29, 2025
cd4735e
Add comment explaining relation of BTreeSet and BTreeMap.
dragoljub-djuric Apr 29, 2025
ab02321
Optimize intersection function.
dragoljub-djuric Apr 29, 2025
f4bf556
Comment union and intersection functions.
dragoljub-djuric Apr 29, 2025
8ea02aa
fix clippy error.
dragoljub-djuric Apr 29, 2025
62a7e5b
.
dragoljub-djuric Apr 29, 2025
666c153
Revert "."
dragoljub-djuric Apr 29, 2025
2da6d8c
.
dragoljub-djuric Apr 29, 2025
75b962b
remove redundant tests
dragoljub-djuric Apr 29, 2025
8f2caca
Merge branch 'main' into EXC-1384-add-stable-b-tree-set-in-stable-str…
dragoljub-djuric Apr 29, 2025
11bb33a
Merge branch 'EXC-1384-add-stable-b-tree-set-in-stable-structures' in…
dragoljub-djuric Apr 29, 2025
2eedd1e
.
dragoljub-djuric Apr 29, 2025
fb39f01
.
dragoljub-djuric Apr 29, 2025
bc9fd12
.
dragoljub-djuric Apr 29, 2025
2214c6f
.
dragoljub-djuric Apr 29, 2025
35d2cd9
.
dragoljub-djuric Apr 29, 2025
c4dc5b5
.
dragoljub-djuric Apr 29, 2025
c7ea053
Merge branch 'main' into add_new_functions_to_b_tree_set
dragoljub-djuric Apr 29, 2025
56a6d41
.
dragoljub-djuric Apr 29, 2025
2465f62
Merge branch 'add_new_functions_to_b_tree_set' of github.com:dfinity/…
dragoljub-djuric Apr 29, 2025
91ad6fe
.
dragoljub-djuric Apr 29, 2025
359b845
Merge branch 'main' into improve_doc_comments_b_tree_set
dragoljub-djuric Apr 29, 2025
b41c70a
.
dragoljub-djuric Apr 29, 2025
5600bdb
.
dragoljub-djuric Apr 29, 2025
630bd5c
Merge branch 'improve_doc_comments_b_tree_set' of github.com:dfinity/…
dragoljub-djuric Apr 29, 2025
61b378c
.
dragoljub-djuric Apr 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions src/btreeset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ where
/// Inserts a key into the set. Returns `true` if the key
/// did not exist in the set before.
///
/// # Complexity
/// O(log n), where n is the number of elements in the set.
///
/// # Example
///
/// ```rust
Expand All @@ -237,6 +240,9 @@ where

/// Returns `true` if the key exists in the set, `false` otherwise.
///
/// # Complexity
/// O(log n), where n is the number of elements in the set.
///
/// # Example
///
/// ```rust
Expand All @@ -253,6 +259,9 @@ where

/// Returns `true` if the set contains no elements.
///
/// # Complexity
/// O(1)
///
/// # Example
///
/// ```rust
Expand All @@ -267,6 +276,9 @@ where

/// Returns the number of elements in the set.
///
/// # Complexity
/// O(1)
///
/// # Example
///
/// ```rust
Expand Down Expand Up @@ -297,6 +309,11 @@ where

/// Removes all elements from the set.
///
/// This operation clears the set by deallocating all memory used by its elements.
///
/// # Complexity
/// O(n), where n is the number of elements in the set.
///
/// # Example
///
/// ```rust
Expand All @@ -314,6 +331,9 @@ where
/// Returns the first key in the set. This key
/// is the minimum key in the set.
///
/// # Complexity
/// O(log n), where n is the number of elements in the set.
///
/// # Example
///
/// ```rust
Expand All @@ -331,6 +351,9 @@ where
/// Returns the last key in the set. This key
/// is the maximum key in the set.
///
/// # Complexity
/// O(log n), where n is the number of elements in the set.
///
/// # Example
///
/// ```rust
Expand All @@ -347,6 +370,9 @@ where

/// Removes a key from the set, returning `true` if it exists.
///
/// # Complexity
/// O(log n), where n is the number of elements in the set.
///
/// # Example
///
/// ```rust
Expand All @@ -363,6 +389,9 @@ where

/// Removes and returns the last element in the set. The key of this element is the maximum key that was in the set.
///
/// # Complexity
/// O(log n), where n is the number of elements in the set.
///
/// # Example
///
/// ```rust
Expand All @@ -379,6 +408,9 @@ where

/// Removes and returns the first element in the set. The key of this element is the minimum key that was in the set.
///
/// # Complexity
/// O(log n), where n is the number of elements in the set.
///
/// # Example
///
/// ```rust
Expand All @@ -395,6 +427,9 @@ where

/// Returns an iterator over the entries of the set, sorted by key.
///
/// # Complexity
/// Creating the iterator is O(1), and iterating over k elements is O(k).
///
/// # Example
///
/// ```rust
Expand All @@ -414,6 +449,9 @@ where
/// Returns an iterator over the entries in the set where keys
/// belong to the specified range.
///
/// # Complexity
/// O(log n) for creating the iterator. Iterating over the range is O(k), where k is the number of elements in the range.
///
/// # Example
///
/// ```rust
Expand All @@ -433,6 +471,9 @@ where
/// Returns an iterator pointing to the first element strictly below the given bound.
/// Returns an empty iterator if there are no keys strictly below the given bound.
///
/// # Complexity
/// O(log n) for creating the iterator, where n is the number of elements in the set.
///
/// # Example
///
/// ```rust
Expand All @@ -454,6 +495,11 @@ where
///
/// The union of two sets is a set containing all elements that are in either set.
///
/// # Complexity
/// O(n + m), where:
/// - n is the size of the first set.
/// - m is the size of the second set.
///
/// # Example
///
/// ```rust
Expand Down Expand Up @@ -518,6 +564,11 @@ where
///
/// The intersection of two sets is a set containing only the elements that are in both sets.
///
/// # Complexity
/// O(n + m), where:
/// - n is the size of the first set.
/// - m is the size of the second set.
///
/// # Example
///
/// ```rust
Expand Down Expand Up @@ -571,6 +622,11 @@ where

/// Returns `true` if this set has no elements in common with another set.
///
/// # Complexity
/// O(n + m), where:
/// - n is the size of the first set.
/// - m is the size of the second set.
///
/// # Example
///
/// ```rust
Expand Down Expand Up @@ -609,6 +665,11 @@ where
///
/// A set `A` is a subset of a set `B` if all elements of `A` are also elements of `B`.
///
/// # Complexity
/// O(n + m), where:
/// - n is the size of the first set.
/// - m is the size of the second set.
///
/// # Example
///
/// ```rust
Expand Down Expand Up @@ -667,6 +728,11 @@ where
///
/// A set `A` is a superset of a set `B` if all elements of `B` are also elements of `A`.
///
/// # Complexity
/// O(n + m), where:
/// - n is the size of the first set.
/// - m is the size of the second set.
///
/// # Example
///
/// ```rust
Expand All @@ -693,6 +759,11 @@ where
/// The symmetric difference of two sets is the set of elements that are in either of the sets,
/// but not in their intersection.
///
/// # Complexity
/// O(n + m), where:
/// - n is the size of the first set.
/// - m is the size of the second set.
///
/// # Example
///
/// ```rust
Expand Down