Code Monkey home page Code Monkey logo

algoclass's People

Contributors

kuychaco avatar lindsayelia avatar newswim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

algoclass's Issues

No solution for BST Delete Node & missing root

Hi, I've made my way here from front end masters. Your course has been great!

I've come to the BST section of your course and in the videos you go over the solutions to deleting a node from a binary search tree. Issues are:

  • You only write pseudo code for the cases that have 0 or 1 child nodes. No solution is shown in the videos or within your solution branches.

  • For the 3rd case in which there are 2 children nodes, you show the code for when we are trying to delete the root and when the value we are deleting is not the root. Issue is, you add in a root property to the code, when throughout the rest of the BST constructor we have not used a root. How would this affect the rest of the code? Would we just replace our parent checks with referencing the root?

Essentially I'm asking for the BST solution to be updated to a full solution. Thank you.

Error in linkedList forEach method?

In the definition of the LinkedList.forEach function:

LinkedList.prototype.forEach = function(callback) { var node = this.head; while (node) { callback(node.value); node = node.next; } };

Doesn't the node = node.next; line incorrectly refer only to a reference (node.next), rather than an actual node object?

Thanks.

Question: Graph depth first traversal

Hi,

Thanks you for these execises!

I have a question about graph depth first traversal - I don't understand why the distance for 4 is 2 in the below example taken from graph.js. I would expect it to be 4, 1 since it is only 1 away from 1.

Example Usage:
1---2---3---5
\ /
4
{
'1': [ 2, 4 ],
'2': [ 1, 3, 4 ],
'3': [ 2, 5 ],
'4': [ 1, 2 ],
'5': [ 3 ]
}
var traverseDF = [];
graph.traverseDepthFirst(1, function(val, distance) { traverseDF.push([val, distance]) });
traverseDF should be [ [ 1, 0 ], [ 2, 1 ], [ 3, 2 ], [ 5, 3 ], [ 4, 2 ] ]

Error in depth first search: Incorrect order

Tree.js traverseDepthFirst doesn't return the correct order.

Tree.prototype.traverseDepthFirst= function(fn){
	this.children.forEach(function(child){
		child.traverseDepthFirst(fn);
	});

	fn(this)
}

Based on the example dataset:

var tree = new Tree(1);
var branch1 = tree.addChild(2);
var branch2 = tree.addChild(3);
var branch3 = tree.addChild(4);
branch1.addChild(5);
branch1.addChild(6);
branch3.addChild(7).addChild(8);

The correct order should be: [1, 2, 5, 6, 3, 4, 7, 8]
Instead it returns: [5, 6, 2, 3, 8, 7, 4, 1]

typo

function Queue_TwoStacks() {

Queue_TwoStack should receive capacity argument and pass to new Stack, like below.

function Queue_TwoStack (capacity) {
this._stackIn = new Stack(capacity);
this._stackOut = new Stack(capacity);
}

clarity on what this mean

1. Implement a stack with a min method which returns the minimum element currently in the stack. This method should have O(1) time complexity. Make sure your implementation handles duplicates.

I can't seem to figure out what the question is asking. When implementing the stack I had it look like so
{1: 'ABC', 2: 'DEF'...}. But won't get the minimum value be 0 ? Or should we use numbers as values ? I am bit confused

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.