Skip to content

Commit

Permalink
DataStructures package in plural seems to make more sense
Browse files Browse the repository at this point in the history
  • Loading branch information
felipernb committed Feb 10, 2015
1 parent 1e39cd4 commit f0ddd46
Show file tree
Hide file tree
Showing 46 changed files with 52 additions and 55 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ dist: all
cp README.md _build
cp CHANGELOG _build

release: dist
cd _build; npm publish

jshint: setup
jshint src

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ npm install --save algorithms
#### Data Structures

```javascript
require('algorithms/data_structure');
require('algorithms/data_structures');
// or
require('algorithms').DataStructure;
require('algorithms').DataStructures;
```

* BST
Expand Down
4 changes: 2 additions & 2 deletions bundle/algorithms.browser.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/algorithms/graph/breadth_first_search.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var Queue = require('../../data_structure/queue');
var Queue = require('../../data_structures/queue');


/**
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/graph/dijkstra.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var PriorityQueue = require('../../data_structure/priority_queue');
var PriorityQueue = require('../../data_structures/priority_queue');

/**
* Calculates the shortest paths in a graph to every node from the node s
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/graph/euler_path.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';


var Graph = require('../../data_structure/graph'),
var Graph = require('../../data_structures/graph'),
depthFirstSearch = require('../../algorithms/graph/depth_first_search');


Expand Down
4 changes: 2 additions & 2 deletions src/algorithms/graph/kruskal.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var DisjointSetForest = require('../../data_structure/disjoint_set_forest'),
Graph = require('../../data_structure/graph');
var DisjointSetForest = require('../../data_structures/disjoint_set_forest'),
Graph = require('../../data_structures/graph');


/**
Expand Down
4 changes: 2 additions & 2 deletions src/algorithms/graph/prim.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var PriorityQueue = require('../../data_structure/priority_queue'),
Graph = require('../../data_structure/graph');
var PriorityQueue = require('../../data_structures/priority_queue'),
Graph = require('../../data_structures/graph');


/**
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/graph/topological_sort.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var Stack = require('../../data_structure/stack'),
var Stack = require('../../data_structures/stack'),
depthFirstSearch = require('../../algorithms/graph/depth_first_search');

/**
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/search/bfs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
var Queue = require('../../data_structure/queue.js');
var Queue = require('../../data_structures/queue.js');

/**
* Breadth-first search for binary trees
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/sorting/heap_sort.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
var MinHeap = require('../../data_structure/heap').MinHeap;
var MinHeap = require('../../data_structures/heap').MinHeap;

/**
* Heap sort first creates a valid heap data structure. Next it
Expand Down
15 changes: 0 additions & 15 deletions src/data_structure.js

This file was deleted.

15 changes: 15 additions & 0 deletions src/data_structures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

// Data Structures
module.exports = {
BST: require('./data_structures/bst'),
Graph: require('./data_structures/graph'),
HashTable: require('./data_structures/hash_table'),
Heap: require('./data_structures/heap'),
LinkedList: require('./data_structures/linked_list'),
PriorityQueue: require('./data_structures/priority_queue'),
Queue: require('./data_structures/queue'),
Stack: require('./data_structures/stack'),
Set: require('./data_structures/set'),
DisjointSetForest: require('./data_structures/disjoint_set_forest')
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var lib = {
DataStructure: require('./data_structure'),
DataStructures: require('./data_structures'),
Graph: require('./graph'),
Math: require('./math'),
Search: require('./search'),
Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/graph/SPFA.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var root = require('../../../'),
SPFA = root.Graph.SPFA,
Graph = root.DataStructure.Graph,
Graph = root.DataStructures.Graph,
assert = require('assert');

describe('SPFA Algorithm', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/graph/bellman_ford.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var root = require('../../../'),
bellmanFord = root.Graph.bellmanFord,
Graph = root.DataStructure.Graph,
Graph = root.DataStructures.Graph,
assert = require('assert');

describe('Bellman-Ford Algorithm', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/graph/bfs_shortest_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var root = require('../../../'),
bfsShortestPath = root.Graph.bfsShortestPath,
Graph = root.DataStructure.Graph,
Graph = root.DataStructures.Graph,
assert = require('assert');


Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/graph/breadth_first_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var root = require('../../../'),
breadthFirstSearch = root.Graph.breadthFirstSearch,
Graph = root.DataStructure.Graph,
Graph = root.DataStructures.Graph,
assert = require('assert');


Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/graph/depth_first_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var root = require('../../../'),
depthFirstSearch = root.Graph.depthFirstSearch,
Graph = root.DataStructure.Graph,
Graph = root.DataStructures.Graph,
assert = require('assert');

describe('Depth First Search Algorithm', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/graph/dijkstra.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var root = require('../../../'),
dijkstra = root.Graph.dijkstra,
Graph = root.DataStructure.Graph,
Graph = root.DataStructures.Graph,
assert = require('assert');

describe('Dijkstra Algorithm', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/graph/euler_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

var root = require('../../../'),
eulerPath = root.Graph.eulerPath,
Graph = root.DataStructure.Graph,
Graph = root.DataStructures.Graph,
assert = require('assert');


Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/graph/floyd_warshall.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var root = require('../../../'),
floydWarshall = root.Graph.floydWarshall,
Graph = root.DataStructure.Graph,
Graph = root.DataStructures.Graph,
assert = require('assert');


Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/graph/minimum_spanning_tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var root = require('../../../'),
kruskal = root.Graph.kruskal,
prim = root.Graph.prim,
depthFirstSearch = root.Graph.depthFirstSearch,
Graph = root.DataStructure.Graph,
Graph = root.DataStructures.Graph,
assert = require('assert');


Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/graph/topological_sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var root = require('../../../'),
topologicalSort = root.Graph.topologicalSort,
Graph = root.DataStructure.Graph,
Graph = root.DataStructures.Graph,
assert = require('assert');

describe('Topological Sort', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/searching/bfs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var root = require('../../..'),
BST = root.DataStructure.BST,
BST = root.DataStructures.BST,
bfs = root.Search.bfs,
assert = require('assert');

Expand Down
2 changes: 1 addition & 1 deletion src/test/algorithms/searching/dfs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var root = require('../../..'),
BST = root.DataStructure.BST,
BST = root.DataStructures.BST,
dfs = root.Search.dfs,
assert = require('assert');

Expand Down
2 changes: 1 addition & 1 deletion src/test/data_structures/bst.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var root = require('../..'),
BST = root.DataStructure.BST,
BST = root.DataStructures.BST,
bfs = root.Search.bfs,
assert = require('assert');

Expand Down
2 changes: 1 addition & 1 deletion src/test/data_structures/disjoint_set_forest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var DisjointSetForest = require('../..').DataStructure.DisjointSetForest,
var DisjointSetForest = require('../..').DataStructures.DisjointSetForest,
assert = require('assert');


Expand Down
2 changes: 1 addition & 1 deletion src/test/data_structures/graph.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var Graph = require('../..').DataStructure.Graph,
var Graph = require('../..').DataStructures.Graph,
assert = require('assert');

describe('Graph - Adjacency list', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/data_structures/hash_table.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var HashTable = require('../..').DataStructure.HashTable,
var HashTable = require('../..').DataStructures.HashTable,
assert = require('assert');

describe('Hash Table', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/data_structures/heap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var heap = require('../..').DataStructure.Heap,
var heap = require('../..').DataStructures.Heap,
assert = require('assert');

describe('Min Heap', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/data_structures/linked_list.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var LinkedList = require('../..').DataStructure.LinkedList,
var LinkedList = require('../..').DataStructures.LinkedList,
assert = require('assert');

describe('LinkedList', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/data_structures/priority_queue.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var PriorityQueue = require('../..').DataStructure.PriorityQueue,
var PriorityQueue = require('../..').DataStructures.PriorityQueue,
assert = require('assert');

describe('Min Priority Queue', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/data_structures/queue.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var Queue = require('../..').DataStructure.Queue,
var Queue = require('../..').DataStructures.Queue,
assert = require('assert');

describe('Queue', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/data_structures/set.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var HashSet = require('../..').DataStructure.Set,
var HashSet = require('../..').DataStructures.Set,
assert = require('assert');

describe('HashSet', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/data_structures/stack.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var Stack = require('../..').DataStructure.Stack,
var Stack = require('../..').DataStructures.Stack,
assert = require('assert');

describe('Stack', function () {
Expand Down

0 comments on commit f0ddd46

Please sign in to comment.