Generate Postorder traversal of Tree from Inorder and Preorder traversal of tree without generating Tree.
Input: In-order traversal in[] = {4, 2, 5, 1, 3, 6} Pre-order traversal pre[] = {1, 2, 4, 5, 3,
Interview Questions asked in Google, Microsoft, Amazon
by Dhaval Dave
Input: In-order traversal in[] = {4, 2, 5, 1, 3, 6} Pre-order traversal pre[] = {1, 2, 4, 5, 3,
by Dhaval Dave
Given a float number convert it into the string WITHOUT using any inbuilt Function
Method 1:
class Float2String { public static void main(String[] args) { float f=7.64f; String
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
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
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.