Instantly share code, notes, and snippets.

😉

Praveen k.praveenKajla

😉
• Sort options
Last active Jan 10, 2018

This Documentation is recieved as an artifact of utmost importance from the desert of the dead.

Humanity is almost dead and machines rule the world and they grow humans and use them as a source for their power. But don't lose the hope. Our Hero Neo is alive and is here to help you. Neo in collabration with Morpheus have built two applications / ...
/
/
Kliento Leseva to keep the humans of planet pocket aces free from any rival machines and to come up with new ideas.

Last active Oct 25, 2017
View intersection.js
 //Write a function to get the intersection point of two Linked Lists. function intersection(ll1,ll2){ let c1 = ll1.length() let c2 = ll2.length() let d = Math.abs(c1-c2) if(c1>c2){ return getIntersection(d,ll1.head,ll2.head) }else{ return getIntersection(d,ll2.head,ll1.head) }
Last active Oct 21, 2017
Given an array of integers, sort the array according to frequency of elements.
View algo.md

-- create BST with freq property updated if duplicate is inserted

-- do inorder traversal and store the data and freq of each node in an auxiliary array count => [{data:data,freq:freq}]

-- sort the count array with descending frequency

-- traverse the array and print every data element in count count[i].freq times

Created Oct 20, 2017
Minimum heap in Javascript => es6
View minHeap.js
 class minHeap{ constructor(capacity){ this.heapSize = -1; this.heap = Array(capacity).fill(-1) } insert(value){ if(this.heapSize+1==this.heap.length){ throw "Overflow Size" } this.heap[this.heapSize+1] = value
Created Oct 20, 2017
Largest subarray with equal number of 0s and 1s => es6
View equal0and1Subarray.js
 //Largest subarray with equal number of 0s and 1s// //Pass 1 var assert = require('assert') function pass1(arr=[]){ let n = arr.length,maxLength = -1,sum=0,start for(let i=0;i
Created Oct 17, 2017
AVLTree in ES6
View AVLTree.js
 class Node{ constructor(d){ this.key = d; this.height = 1 this.left = null this.right = null } }
Last active Oct 15, 2017
Write a function rotate(ar[], d, n) that rotates arr[] of size n by d element
View leftArrayRotate.js
 //Write a function rotate(ar[], d, n) that rotates arr[] of size n by d elements //https://www.youtube.com/watch?v=utE_1ppU5DY //pass 1 //1.copy first d elements in temp array //2.move original array forward by d //3.start updating vlues in originl array from n-d th position // time complexity n space complexity d function rotate1(arr=[],d){ let n = arr.length let temp = []
Last active Oct 14, 2017