benoitvallon / computer-science-in-javascript Goto Github PK
View Code? Open in Web Editor NEWComputer science reimplemented in JavaScript
License: MIT License
Computer science reimplemented in JavaScript
License: MIT License
is there a known issue for sorting when there is 0 in the array, I used a code similar to the one that you used in bubble-sort.js , but whenever I add 0 to the array it stays in same position and sorting starts after the 0
var array = [4, 7, 0, 5, 1, 3, 6, 2, 9, 8, 10, 13, 15, 12, 14, 11];
the result sorted array would be
[ 4, 7, 0, 1, 2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15 ]
There is no implementation of Priority Queue in this project.
Priority Queue is a very important data structure and it should be included in this project as well.
Splice in the for loop shifts the elements in the array and skips the sibling of the node that was removed.
Fix PR:
You can test with:
const tree = new Tree();
tree.add('ceo');
tree.add('cto1', 'ceo');
tree.add('cto2', 'ceo');
tree.add('cto3', 'ceo');
tree.add('dev1', 'cto1');
tree.add('dev2', 'cto1');
tree.add('dev3', 'cto1');
tree.add('dev2', 'dev3');
tree.add('dev1', 'cto2');
tree.add('dev2', 'cto2');
tree.add('dev3', 'cto2');
tree.add('dev1', 'cto3');
tree.add('dev2', 'cto3');
tree.add('dev3', 'cto3');
tree.printByLevel();
tree.remove('dev2');
tree.printByLevel();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.