Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions challenges/topologicalSort/topologicalSort.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function topologicalSort(input) {

}

module.exports = topologicalSort;
18 changes: 18 additions & 0 deletions challenges/topologicalSort/topologicalSort.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const topologicalSort = require('./topologicalSort');

const testOne = {
input: [[1, 0]],
output: [0, 1],
};

const testOneA = {
input: [[1, 0], [2, 0], [3, 1], [3, 2]],
output: [[0, 1, 2, 3], [0, 2, 1, 3]],
};

describe('topologicalSort Test', () => {
test('testOne', () => {
const result = topologicalSort(testOne.input);
expect(testOneA.output).toContainEqual(result);
});
});
1 change: 1 addition & 0 deletions challenges/topologicalSort/topologicalSortNotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
topologicalSort Notes go here!
2 changes: 2 additions & 0 deletions challenges/topologicalSort/topologicalSortSpec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
topologicalSort Spec go here!
-https://www.geeksforgeeks.org/find-the-ordering-of-tasks-from-given-dependencies/