nimrod46 / data-structures-and-algorithms Goto Github PK
View Code? Open in Web Editor NEWMy code solution for Andrei Neagoie's online udemy course "Master the Coding Interview: Data Structures + Algorithms"
My code solution for Andrei Neagoie's online udemy course "Master the Coding Interview: Data Structures + Algorithms"
The code for merge sorted arrays in arrays doesn't seem to work with inputs that have -ve values and are sorted like for the following input :
int[] ar1 = {-5, 3, 6, 12, 15};
int[] ar2 = {-12, -10, -6, -3, 4, 10};
Kindly check .
The 3rd function does not work as the solution. This is because you are prepopulating the hash table with all the elements in the array. So when we check the hash table to see if it contains the element in the array, the if condition is always going to be True.
The expected result for {1,5,8,5,1,8,8,7,4,4,10} should return 5 and not 1.
Hi - There's an issue with your insertion sort algorithm that arises if the same number arises in the array twice.
On line 23:
if (list.get(i) > list.get(j - 1) && list.get(i) < list.get(j))
needs to be changed to
if (list.get(i) >= list.get(j - 1) && list.get(i) < list.get(j))
and then it will sort correctly.
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.