-
Topological Sort Algorithm
Are there any topological sorting algorithms that, given a binary matrix A, (1) find the number of distinct rows of A and (2) for any row find the set of all equal rows? Can you give me some references of where I can find them?
-
Game of Jack Straws
In the game of Jack Straws, a number of plastic or wooden "straws" are dumped on the table and players try to remove them one-by-one without disturbing the other straws. In the question here, we are concerned with the following, related problem: First n straws are dumped on the table. Next, for every pair of straws, we want to determine if the straws are connected by a path of touching straws. In other...
-
Intersection of two convex polygons
Suppose that you are given m convex polygons P1; P2; : : : ; Pm in the plane. Let ni denote the
number of vertices on Pi and n =
Pm
i=1 ni. The vertices of each polygon is listed in counter-
clockwise order, starting at the leftmost vertex of Pi (that is, the one with the smallest x-
coordinate). Two polygons Pi and Pj are said to intersect if they contain any point in... -
Algorithm to print count and possible string outcomes of a given input string
Write an Efficient algorithm to print count and possible string outcomes of a given input string by retaining order and considering all characters during this process
Problem: given a input string as "0000" and following input scheme for the zeroes, print the possible outcomes by retaining order of the characters. input scheme: a "0" b "00" c "000" d "0000" example: "aaaa" is one string... -
Book Index Rare Order
A book collector has a special requirement. He has a book which contains a letter with English alphabets. But the sequence of letters is not the standard English. i.e. the alphabet sequence are not A,B,C.....Z.
He has to find the letter sequence from the Index for the book. What could be the right algorithm for this?
Sample Input -
Suppose these are the below Indexes... -
Ans