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

Earth - Emily #3

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Earth - Emily #3

wants to merge 7 commits into from

Conversation

emirry
Copy link

@emirry emirry commented Mar 31, 2021

DRAFT
I'm just submitting what I have for now. Just a warning this is messy! I plan on implementing the height function, include time/space complexities, and clean everything up this weekend!

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The methods you have so far work, and work, although you don't have time/space complexity. I'm looking forward to the height function going forward.

lib/tree.js Outdated
@@ -12,34 +12,169 @@ class Tree {
this.root = null;
}

addHelper(value) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't seem to be using this function.

this.addHelper(this.root, newNode);
}
}

// Time Complexity: ?
// Space Complexity: ?
add(key, value) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 but time/space complexity?

// } else {
// this.addHelper(key.right, newNode);
// }
// };
}

// Time Complexity: ?
// Space Complexity: ?
find(key) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 but time/space complexity?

}
}

return null;
}

// Time Complexity: ?
// Space Complexity: ?
inorder() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 but time/space complexity?

value: current.value
});

this.inorderHelper(current.right, values);
}

// Time Complexity: ?
// Space Complexity: ?
preorder() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 but time/space complexity?

});

this.preorderHelper(current.left, values);
this.preorderHelper(current.right, values);
}

// Time Complexity: ?
// Space Complexity: ?
postorder() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 but time/space complexity?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants