Repository: pbiswas101/Mathball (js)

Issue:
Kaprekar Number
### Do the checklist before filing the issue:

- [ ] Is this something you can **debug and fix**?
- [x] Do you have Node.js and all the relevant dev-dependencies installed?
- [ ] Is this a **feature request** that you can add?

###### NOTE: Provide a clear and concise description of the feature that needs to be added! Or if its a bug, then provide the necessary steps to reproduce it.

- *Give your answer below:*

------------

[Function: **M.isKaprekar()**] needs to be added!
For more info:

https://www.geeksforgeeks.org/kaprekar-number/

*M.isKaprekar()* needs to accept a positive integer and all other arguments passed should throw a type error which needs to be handled gracefully! For error handling, you should refer to how other features like M.isArmstrong() is implemented.

Pull request description:
Corrected documentation of Graphs. Corrected binary-tree to Binary Se…
…arch Tree

### Do the checklist before submitting the PR:

- [x] Have you read the guidelines mentioned in **CONTRIBUTING.md**?
- [x] Have you squashed your commits?

**Q**: What version of *Node.js* you've used in the project? (`e.g. Node v10.11.0`)
**A**:v11.6.0

**Q**: Mention the *Issue Number*! (`e.g. Fixed #8`)
**A**:Issue #209 

- *Give additional information regarding the PR below:*

------------


Patch:
diff --git a/docs/Graph/index.md b/docs/Graph/index.md
index 72723a4..4bb38cd 100644
--- a/docs/Graph/index.md
+++ b/docs/Graph/index.md
@@ -1,5 +1,7 @@
 # Graph
-The `M.Graph()` function returns an object upon which various Graph-based operations can be performed.
+The `M.Graph()` function returns an object upon which various Graph-based operations can be performed. This implementation uses a **adjacency matrix** representation to store the the graph. This is a **unweighted directed graph**. 
+
+The implementation involves adding all the involved edges, with their names being __strings__. Then the edges can be added as per requirement, while remembering that this graph is **directed**.
 
 ### Syntax
 > new M.Graph(noOfVertices)
@@ -34,7 +36,7 @@ console.log(g);   // Graph { noOfVertices: 6, Adjlist: Map {} }
 > g.addVertex(vertex)
 
 ###### Argument
-> Number/String
+> String
 
 ###### Return
 > Object
@@ -57,7 +59,7 @@ const vertices1 = [ 1,2,3,4];
 for (var i = 0; i < vertices1.length; i++) { 
     g2.addVertex(vertices1[i]); 
 } 
-console.log(g2);   //  // Graph { noOfVertices: 4, Adjlist: Map { 1 => [ 2 ], 2 => [ 3 ], 3 => [ 4 ], 4 => [ 1 ] } }
+console.log(g2);   //  // Graph { noOfVertices: 4, Adjlist: Map { 1 => [], 2 => [], 3 => [], 4 => [] } }
 ```
 
 ###### Info
@@ -69,7 +71,7 @@ Implemented using JavaScript's built-in `set` function.
 > g.addEdge(source, destination)
 
 ###### Arguments
-> Number/String
+> String
 
 ###### Return
 > Number
@@ -120,7 +122,7 @@ console.log(g.printGraph());   //  Map { 'A' => [ 'B' ], 'B' => [ 'C' ], 'C' =>
 > g.removeVertex(vertex)
 
 ###### Argument
-> Number/String
+> String
 
 ###### Return
 > Boolean
@@ -154,7 +156,7 @@ Implemented using JavaScript's built-in `delete` function.
 > g.removeEdge(vertexName, edgeName)
 
 ###### Arguments
-> Number/String
+> String
 
 ###### Return
 > String
@@ -190,7 +192,7 @@ Implemented using JavaScript's built-in `get`, `indexOf`, `toString` and `splice
 > g.bfs(startNode)
 
 ###### Arguments
-> Number/String
+> String
 
 ###### Return
 > Object
@@ -220,7 +222,7 @@ Implemented using JavaScript's built-in `from`, `keys`, `includes`, `push`,  and
 > g.dfs(startNode)
 
 ###### Arguments
-> Number/String
+> String
 
 ###### Return
 > Object
diff --git a/src/binary-tree/index.js b/src/binary-search-tree/index.js
similarity index 98%
rename from src/binary-tree/index.js
rename to src/binary-search-tree/index.js
index b98e1a4..525df59 100644
--- a/src/binary-tree/index.js
+++ b/src/binary-search-tree/index.js
@@ -6,7 +6,7 @@ class Node{
     }
 }
 
-class BinaryTree{
+class BinarySearchTree{
     constructor(){
         this.root = null;
     }
@@ -159,4 +159,4 @@ class BinaryTree{
     }
 }
 
-module.exports = BinaryTree;
\ No newline at end of file
+module.exports = BinarySearchTree;
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index 40aad51..1fa205a 100644
--- a/src/index.js
+++ b/src/index.js
@@ -35,7 +35,7 @@ const abs = require('./absolute'),
 
 /* Data Structures */
 const Matrix = require('./Matrix'),
-	BinaryTree = require('./binary-tree'),
+	BinarySearchTree = require('./binary-search-tree'),
 	Graph = require('./graph'),
 	PriorityQueue = require('./priority-queue'),
 	Stack = require('./stack');
@@ -71,7 +71,7 @@ module.exports = {
 	inverse,
 	count,
 	union,
-	BinaryTree,
+	BinarySearchTree,
 	PriorityQueue,
 	Stack,
 	Graph,


Test patch:
diff --git a/test/binarytree-spec.js b/test/binarysearchtree-spec.js
similarity index 93%
rename from test/binarytree-spec.js
rename to test/binarysearchtree-spec.js
index 274b29b..693a31b 100644
--- a/test/binarytree-spec.js
+++ b/test/binarysearchtree-spec.js
@@ -1,10 +1,10 @@
 const assert = require('assert'),
-        BinaryTree = require('../src/binary-tree'),
-        tree = new BinaryTree();
+        BinarySearchTree = require('../src/binary-search-tree'),
+        tree = new BinarySearchTree();
 
-    describe('[function: BinaryTree]', () => {
+    describe('[function: BinarySearchTree]', () => {
         it("should be a function", () => {
-            assert.strictEqual(typeof BinaryTree, 'function');
+            assert.strictEqual(typeof BinarySearchTree, 'function');
         });
 
         it('should return "Empty Tree" when remove() is called', () => {