Skip to content

Instantly share code, notes, and snippets.

View alguerocode's full-sized avatar
🎯
Focusing

salah alhashmi alguerocode

🎯
Focusing
View GitHub Profile
@alguerocode
alguerocode / menu.cpp
Created July 5, 2022 08:24
C++ menu system using ncurses
#include <ncurses.h>
int main()
{
initscr();
refresh();
noecho();
WINDOW *menuwin = newwin(10, 40, 2, 4);
box(menuwin, 0, 0);
class TreeNode {
constructor(value) {
this.value = value;
this.left = null;
this.right = null;
}
}
class BainaryTree {
constructor(root) {
@alguerocode
alguerocode / deep-equal.js
Last active June 22, 2022 07:23
deep equal operation in javascript
function deepEquals(value1, value2) {
if(typeof value1 !== typeof value2) return false;
if(value1 === value2) return true;
if (typeof value1 !== "object" && typeof value2 !== "object") {
// NaN type validation;
const [isValue1NaN, isValue2NaN] = [...arguments].map((value) => Number.isNaN(value) && typeof value === "number");
if (isValue1NaN && isValue2NaN) return true;
@alguerocode
alguerocode / linked-list.js
Created June 21, 2022 07:55
understandable singly linked list in javascript
// list node constructor
function ListNode(val) {
this.next = null;
this.value = val;
}
const MyLinkedList = function () {
this.head = null; // the head of the linked lsit
this.size = 0; // use the size to have addtional useful validation
@alguerocode
alguerocode / main.cpp
Created June 6, 2022 11:10
c++ function to extract all the Subsequences in the array of numbers ranged between 1 to 4
#include <iostream>
int subsequence(int arr[], int length)
{
// counter the number of Subsequences
int counter = 0;
for (size_t i = 0; i < length; i++)
{
@WebRTCGame
WebRTCGame / JavascriptBooks.md
Last active April 10, 2024 01:44
Free Javascript Books

Useful Links

23 Free JavaScript Books

A curated collection of awesome & free JavaScript books to help you learn the JavaScript programming language.

If you know of any other free JavaScript books that you think should be on this list, please let me know in the comments section and I will get them added.

@marcin-chwedczuk
marcin-chwedczuk / btree.js
Created May 30, 2016 15:26
BTree implementation in JavaScript
#!/usr/bin/env node
const NKEYS = 4;
function arrayOfSize(size) {
var a = Array(size);
for (var i = 0; i < size; i += 1)
a[i] = null;