-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from calcit-lang/docs-ops
optimizations on loop_get, drop_left, push_left, drop_right
- Loading branch information
Showing
11 changed files
with
1,222 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
extern crate im_ternary_tree; | ||
use im_ternary_tree::TernaryTreeList; | ||
|
||
pub fn main() -> Result<(), String> { | ||
let mut tree: TernaryTreeList<usize> = TernaryTreeList::Empty; | ||
|
||
for idx in 0..60 { | ||
tree = tree.push_right(idx); | ||
} | ||
|
||
for _ in 0..59 { | ||
tree = tree.drop_right(); | ||
println!("{}", tree.format_inline()); | ||
} | ||
|
||
let mut origin4: Vec<usize> = vec![]; | ||
for idx in 0..60 { | ||
origin4.push(idx); | ||
} | ||
let mut data4 = TernaryTreeList::from(&origin4); | ||
|
||
for _ in 0..59 { | ||
data4 = data4.drop_right(); | ||
println!("{}", data4.format_inline()); | ||
} | ||
|
||
// let mut data = TernaryTreeList::Empty; | ||
|
||
// for idx in 0..1000 { | ||
// data = data.push(idx) | ||
// } | ||
|
||
// let mut d = data; | ||
|
||
// while d.len() > 1 { | ||
// d = d.drop_right(); | ||
// println!("{}", d.format_inline()); | ||
// } | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.