Skip to content

Instantly share code, notes, and snippets.

View sebastianfdez's full-sized avatar
🏠
Working from home

SF sebastianfdez

🏠
Working from home
View GitHub Profile
@pgpbpadilla
pgpbpadilla / sizeof.js
Last active May 1, 2020 14:01
Javascript `sizeof`: Calculates the memory used by an object.
/*jslint indent:2, browser: true, node: true*/
/** Taken from: http://stackoverflow.com/a/11900218/400544 */
'use strict';
(function () {
var typeOfWindow = typeof window;
function sizeof(object) {
@sebastianfdez
sebastianfdez / BTree.js
Last active May 18, 2024 06:33
FINAL COMPLETE BTREE CLASS
export class BTreeNode {
constructor(isLeaf) {
/**
* @type {number[]} list of values in the node
*/
this.values = [];
/**
* @type {boolean} is a leaf
*/
this.leaf = isLeaf;