function quickSort(arr) { if (arr.length <= 1) { return arr; } const pivot = arr[0]; con…
function gcd(a,b) { if(a==0) return b; return gcd(b%a,a); } var a = 270, b = 192; conso…
function combsum(arr,sum1) { newarr = []; backtrack(arr,0,sum1,newarr) } functi…
class Graph { constructor() { this.vertices = []; this.adjacencyList = {}; } addVertex(ve…
class Node { constructor(value) { this.value = value; this.left = null; this.right = null; …
class Node { constructor(value) { this.value = value; this.left = null; this.right = null; …
function binarySearch(a,x,low,high) { const mid=(low+high)/2; if(x==a[mid])…
class LLNode { constructor(item) { this.key=item; this.left=thi…
class LLNode { constructor(data) { this.data=data; this.next=nu…
class Stack { constructor() { this.items = []; } // Pushes an element onto the stack push(e…
Social Plugin