Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement naive dynamic insertion #25

Merged
merged 1 commit into from Jul 3, 2019

Conversation

@MnO2
Copy link
Collaborator

commented Jul 2, 2019

  • A simplified approach based on the algorithm in the paper "An Efficient Implementation of Trie Structures"
  • It has space for optimization.
@codecov-io

This comment has been minimized.

Copy link

commented Jul 2, 2019

Codecov Report

Merging #25 into master will decrease coverage by 0.91%.
The diff coverage is 78.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
- Coverage   81.84%   80.93%   -0.92%     
==========================================
  Files           2        2              
  Lines         314      430     +116     
==========================================
+ Hits          257      348      +91     
- Misses         57       82      +25
Impacted Files Coverage Δ
src/lib.rs 80.15% <78.33%> (-0.75%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f7c047e...a60b637. Read the comment docs.

@MnO2 MnO2 requested a review from andelf Jul 3, 2019

@andelf

andelf approved these changes Jul 3, 2019

src/lib.rs Outdated
}
}

fn look_for_free_slot(&mut self, s: usize, siblings: &Vec<usize>) -> usize {

This comment has been minimized.

Copy link
@andelf

andelf Jul 3, 2019

Owner

use siblings: &[usize] ?

src/lib.rs Outdated
// TODO: compare the size and choose the smaller one to move
self.relocate(b as usize, new_base, &siblings);

if let Some(next_c) = iter.peek() {

This comment has been minimized.

Copy link
@andelf

andelf Jul 3, 2019

Owner

if let Some(&next_c)
then remove .clone()

src/lib.rs Outdated
b = self.base[p];
} else if self.check[p] <= 0 {
// it's a free slot
if let Some(next_c) = iter.peek() {

This comment has been minimized.

Copy link
@andelf

andelf Jul 3, 2019

Owner

if let Some(&next_c)
then remove .clone()

@MnO2 MnO2 force-pushed the MnO2:implement-insertion branch from 2de5e51 to a60b637 Jul 3, 2019

@MnO2 MnO2 merged commit 003245d into andelf:master Jul 3, 2019

1 of 3 checks passed

codecov/patch 78.33% of diff hit (target 81.84%)
Details
codecov/project 80.93% (-0.92%) compared to f7c047e
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.