Skip to content

Christabel - water#2

Open
cescarez wants to merge 17 commits intoAda-C14:masterfrom
cescarez:master
Open

Christabel - water#2
cescarez wants to merge 17 commits intoAda-C14:masterfrom
cescarez:master

Conversation

@cescarez
Copy link

No description provided.

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.

Nice work Christabel, you hit the main learning goals here. I left a few comments, but otherwise this is very well done.

Comment on lines +20 to 23
Time Complexity: O(1)
Space Complexity: O(1)
*/
addFirst(value) {

Choose a reason for hiding this comment

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

👍

Comment on lines +30 to 33
Time Complexity: O(n)
Space Complexity: O(1)
*/
search(value) {

Choose a reason for hiding this comment

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

👍

Comment on lines +45 to 48
Time Complexity: O(n)
Space Complexity: O(1)
*/
findMax() {

Choose a reason for hiding this comment

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

👍

*/
findMin() {
throw new Error("This method hasn't been implemented yet!");
let min = null;

Choose a reason for hiding this comment

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

Maybe instead assign min to the 1st element in the linked list. Then you don't have to worry about if min is null.

Comment on lines +83 to 86
Time Complexity: O(n)
Space Complexity: O(1)
*/
length() {

Choose a reason for hiding this comment

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

👍

Comment on lines +226 to 229
Time Complexity: O(n)
Space Complexity: O(1)
*/
hasCycle() {

Choose a reason for hiding this comment

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

This won't handle a cycle which does not include the head.

Comment on lines +276 to 279
Time Complexity: O(n)
Space Complexity: O(1)
*/
getLast() {

Choose a reason for hiding this comment

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

👍

Comment on lines +292 to 295
Time Complexity: O(n)
Space Complexity: O(1)
*/
insertAscending(value) {

Choose a reason for hiding this comment

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

👍

Comment on lines +183 to 186
Time Complexity: O(n)
Space Complexity: O(1)
*/
findMiddleValue() {

Choose a reason for hiding this comment

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

👍

Comment on lines +200 to 203
Time Complexity: O(n)
Space Complexity: O(1)
*/
findNthFromEnd(n) {

Choose a reason for hiding this comment

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

👍

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