Skip to content

Commit fbfda7d

Browse files
committed
Adding Hash Table
1 parent 3b04de6 commit fbfda7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+262
-6165
lines changed

.prettierignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Ignore artifacts:
22
build
33
coverage
4-
.venv

.vscode/launch.json

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
62
"configurations": [
73
{
8-
"type": "node",
4+
"args": [
5+
"-u",
6+
"tdd",
7+
"--timeout",
8+
"999999",
9+
"--colors",
10+
"${workspaceFolder}/test"
11+
],
12+
"internalConsoleOptions": "openOnSessionStart",
13+
"name": "Mocha Tests",
14+
"program": "mocha",
915
"request": "launch",
10-
"name": "Launch Program",
1116
"skipFiles": ["<node_internals>/**"],
12-
"program": "${workspaceFolder}/index.js"
17+
"type": "node"
1318
}
1419
]
1520
}

index.js

+8-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
import DoublyLinkedList from "./src/data-structures/doubly-linked-lists/DoublyLinkedList";
1+
import HashTable from "./src/data-structures/hash-table/HashTable.js";
22

3-
const ll = new DoublyLinkedList();
3+
const hashTable = new HashTable(3);
44

5-
const array = [
6-
{ value: 1, key: "test1" },
7-
{ value: 2, key: "test2" },
8-
{ value: 3, key: "test3" },
9-
{ value: 4, key: "test4" },
10-
{ value: 5, key: "test5" },
11-
{ value: 6, key: "test6" },
12-
];
5+
hashTable.set("a", "sky-old");
6+
hashTable.set("a", "sky");
7+
hashTable.set("b", "sea");
8+
hashTable.set("c", "earth");
9+
hashTable.set("d", "ocean");
1310

14-
ll.fromArray(array);
15-
16-
const stringifier = ({ key, value }) => `\nKey: ${key} | Value: ${value}\n`;
17-
18-
console.log(ll.toString(stringifier));
19-
20-
const finder = (val) => val.value === 4;
21-
22-
let node = ll.find(finder);
23-
24-
console.log(node);
11+
console.log("All the keys", hashTable.getValues());

src/algorithmic-complexity/.ipynb_checkpoints/Algorithmic Complexity-checkpoint.ipynb

-32
This file was deleted.

src/algorithmic-complexity/Algorithmic Complexity.ipynb

-147
This file was deleted.
-128 KB
Binary file not shown.
-79.4 KB
Binary file not shown.

src/data-structures/doubly-linked-lists/.ipynb_checkpoints/Doubly Linked Lists-checkpoint.ipynb

-6
This file was deleted.

0 commit comments

Comments
 (0)