Get K Max and Delete K Max in stream of Incoming Integers
Solution 1 : Using Min Heap
Algorithm :
1) Keep a Min & Max Heap of K size 2) Store first K elements
Interview Questions asked in Google, Microsoft, Amazon
by Dhaval Dave
1) Keep a Min & Max Heap of K size 2) Store first K elements
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave
char * strtok ( char * str, const char * delimiters );
What it does : Split string into tokens
A sequence of calls to this function split str into tokens,
which are
by Dhaval Dave
by Dhaval Dave
A Simple Binary Search for Integers
BinarySearch(A[0..N-1], value) { low = 0 high = N - 1 while (low <= high) { mid = low + ((high - low) / 2) if (A[mid] > value)
by Dhaval Dave
Linked List :
Node(1) -> Node(2) -> Node(3) -> Node(4) -> Node(5) -> Node(6) -> Node(7)
by Dhaval Dave
by Dhaval Dave
Implementation of Binary Tree in Java Language.
import java.io.*; import java.util.*; class Node { public int iData; // data item (key) public double dData; // data item public Node leftChild; // this node's left child
by Dhaval Dave
In the mathematical field of graph theory, a spanning tree T of a connected, undirected graph G is a tree that includes all of the vertices and some or all of the edges of G.