/*
* usage: myTail [-n] [<filename>]
*/
#include <stdio.h> #include <stdlib.h> #define MAX_LINE_LEN 1024 #define DEFAULT_N 10 int main(int argc, char *argv[]) { char **tail; int count = DEFAULT_N, n, i, headX = 0, tailX… Read More
Interview Questions asked in Google, Microsoft, Amazon
by Dhaval Dave
/*
* usage: myTail [-n] [<filename>]
*/
#include <stdio.h> #include <stdlib.h> #define MAX_LINE_LEN 1024 #define DEFAULT_N 10 int main(int argc, char *argv[]) { char **tail; int count = DEFAULT_N, n, i, headX = 0, tailX… Read More
by Dhaval Dave
Power Set Power set P(S) of a set S is the set of all subsets of S. For example S = {a, b, c} then P(s) =
by Dhaval Dave
Stock Price on each day is given in an array.
Example : [ 10, 12, 7, 5, 9, 15, 13, 18 ]
Find the max profit that you can make by buying and selling in … Read More
by Dhaval Dave
Trie also called prefix tree (as they can be searched by prefixes).
The term trie comes from retrieval.
In the example shown, keys are listed in the nodes and values below them. Each … Read More
by Dhaval Dave
In a linked list, the items are linked together through a single next pointer.
In a binary tree, each node can have 0, 1 or 2 subnodes, where (in case of a … Read More
by Dhaval Dave
Here is the implementation of Binary Search Tree in Java.
Class Structure, Get Set Methods, Binary Tree Operation, Pre-Post-InOrder code … Read More
by Dhaval Dave
Given a Binary Search Tree (BST) and a positive integer k, find the k’th largest element in the Binary Search Tree.
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave