Consider a node X in a Binary Tree. Given that X has two children, let Y be Inorder successor of X. Which of the following… Read More

All Medium Articles

Which of the following operators cannot be overloaded (A) . (Member Access or Dot operator) (B) ?: (Ternary or Conditional Operator ) (C) :: (Scope… Read More

Evaluate an expression represented by a String. The expression can contain parentheses, you can assume parentheses are well-matched. For simplicity, you can assume only… Read More

Given n dice each with m faces, numbered from 1 to m, find the number of ways to get sum X. X is the summation… Read More

An undirected graph is called Biconnected if there are two vertex-disjoint paths between any two vertices. In a Biconnected Graph, there is a simple cycle… Read More

Given a string, eliminate all “b” and “ac” in the string, you have to replace them in-place, and you are only allowed to iterate over… Read More

My Google Interview Experience, [Hope this is helpful] I am AnandhaKumar .P – 2012 IT pass out from College Of Engineering Guindy, Anna University.Hey geek!… Read More

A directed graph is strongly connected if there is a path between all pairs of vertices. A strongly connected component (SCC) of a directed graph… Read More

Given a Weighted Directed Acyclic Graph and a source vertex in the graph, find the shortest paths from given source to all other vertices. Recommended:… Read More

Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge u v, vertex u comes… Read More

Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v… Read More

Given a singly linked list, swap kth node from beginning with kth node from end. Swapping of data is not allowed, only pointers should be… Read More

Consider the problem of searching an element x in an array ‘arr[]’ of size n. The problem can be solved in O(Logn) time if. 1)… Read More

Given an array of integers, sort the array according to frequency of elements. For example, if the input array is {2, 3, 2, 4, 5,… Read More

Given string str, the task is to find the minimum number of characters to be inserted to convert it to a palindrome. Before we go… Read More

Given a dictionary of words and an input string, find the longest prefix of the string which is also a word in dictionary. Examples:Attention reader!… Read More

Following is a typical recursive implementation of QuickSort for arrays. The implementation uses last element as pivot. Attention reader! Don’t stop learning now. Get hold of… Read More

Introduction: B-Tree is a self-balancing search tree. In most of the other self-balancing search trees (like AVL and Red-Black Trees), it is assumed that everything… Read More

An array contains both positive and negative numbers in random order. Rearrange the array elements so that positive and negative numbers are placed alternatively. Number… Read More