# Category Archives: Algorithms

We introduced graph coloring and applications in previous post. As discussed in the previous post, graph coloring is widely used. Unfortunately, there is no efficient… Read More
Location: Guagaon Position: Software Developer I decided to write this post because when i was preparing, I didn’t find any help on google about the… Read More
Given n line segments (p1, q1), (p2, q2), … (pn, qn), find if the given line segments intersect with each other or not. Example: Input:… Read More
Travelling Salesman Problem (TSP):  Given a set of cities and the distance between every pair of cities, the problem is to find the shortest… Read More
We have discussed Asymptotic Analysis, and Worst, Average, and Best Cases of Algorithms. The main idea of asymptotic analysis is to have a measure of… Read More
Given two arrays X[] and Y[] of positive integers, find a number of pairs such that x^y > y^x where x is an element from… Read More
Given a number ‘n’, how to check if n is a Fibonacci number. First few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8,… Read More
Given a string, recursively remove adjacent duplicate characters from the string. The output string should not have any adjacent duplicates. See the following examples. Examples: … Read More
Online round: 1. There exist a binary tree with each node containing a character (lower case letters for leaf nodes and upper case letters for… Read More
Given a rope of length n meters, cut the rope in different parts of integer lengths in a way that maximizes product of lengths of… Read More
The lower bound for the Comparison based sorting algorithm (Merge Sort, Heap Sort, Quick-Sort .. etc) is Ω(nLogn), i.e., they cannot do better than nLogn.… Read More
Radix Sort Algorithm is a sorting algorithm that sorts data by grouping individual digits or elements of keys together. It is implemented by sorting from… Read More
20 Objective type questions (Technical: OS, Java, Networking) and 2 programs. Time given was 90 minutes.  1) Longest Remaining Time Scheduling  2) Threads  3) subnetmask… Read More
Morgan Stanley interview experience 1st round: (90 minutes) It was multiple choice questions round. It consists of 3 sections: 1. This section had computer fundamental… Read More
We have been writing about efficient algorithms to solve complex problems, like shortest path, Euler graph, minimum spanning tree, etc. Those were all success stories… Read More