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)
Interview Questions asked in Google, Microsoft, Amazon
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.
by Dhaval Dave
In graph theory, breadth-first search (BFS) is a strategy for searching in a graph when search is limited to essentially two operations: (a) visit and inspect a node of a graph; (b) gain access to
by Dhaval Dave
Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. One starts at the root (selecting some arbitrary node as the root in the case of a graph) and explores
by Dhaval Dave
In computer science, a doubly-linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains two fields, called links, that are references to the previous
by Dhaval Dave
In the last node of a list, the link field often contains a null reference, a special value used to indicate the lack of further nodes. A less common convention is to make it point
by Dhaval Dave