Skip to content

Instantly share code, notes, and snippets.

View 0xabdulkhalid's full-sized avatar
🌟
| WebxDev |

Abdul Khalid 0xabdulkhalid

🌟
| WebxDev |
View GitHub Profile
@0xabdulkhalid
0xabdulkhalid / linkedList.js
Created October 1, 2023 16:28
Implementing Singly Linked-List using JavaScript
class Node {
constructor(value) {
this.value = value || null;
this.next = null;
}
}
class LinkedList {
constructor(head) {
this.head = head || null;
@0xabdulkhalid
0xabdulkhalid / binaryTreeTraversals.js
Last active October 1, 2023 01:56
Binary Tree traversal program written in JS to demonstrate Breadth-First Search & Depth-First Search techniques.
class Node {
constructor(data) {
this.data = data;
this.left = null;
this.right = null;
}
// Method to insert a node into the Binary Search Tree rooted at this node
insert(data) {
if (data <= this.data) {