-
-
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... -
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... -
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... -
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...
-
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?
-
-
Python - How to Write a function
How to Write a function kinda_format ( ) that take three arguments (each of which positive int ) - a,b,c- and tests whether the equality a^n +b^n=c^n holds for each n{2,3,...,10}. The function should return false if the equality does not hold for any value of n in the given range, and if there is a value of n for which the equality holds, the lowest such value (as in int)
-
How many trees are now left in Granada National Park?
Peter has a method for solving quadratic equations. For example, Peter solves 6x2
+ x – 2 = 0 as follows:
(a) Peter multiplies the leading coefficient (6) by the constant coefficient (2)
to get x2 + x – 12 = 0 to get (x+4)(x-3) = 0
(b) Peter then replaces each x by 6x (x times the leading coefficient) to get
(6x+4)(6x-3) = 0
(c) Peter then simplifies this equation to get (3x+2)(2x-1) = 0, which solves
the original equation.
Prove or disprove that Peter’s method always works.
">Two mathematicians were surveying the damage done to Granada National Park by Hurricane Ivan. “It could have been worse,” said one. “Less than one third of the trees were lost.” His friend replied, “Yes, in fact if you multiply by 10 the number formed by taking the last two digits of the number of trees there used to be, and add to this the number formed by removing the last two digits of the number of trees there used to be, then you obtain the number of trees there is now". Not to be outdone, the first mathematician said “And if you take the number of trees that were lost, and reverse the order of the last two digits, and then insert a zero in front of the last two digits, then you get the number of trees that there used to be plus the number of trees that there are now”.How many trees are now left in Granada National Park? Peter has a method for solving quadratic equations. For example, Peter solves 6x2+ x – 2 = 0 as follows:(a) Peter multiplies the leading coefficient (6) by the constant coefficient (2)to get x2 + x – 12 = 0 to get (x+4)(x-3) = 0(b) Peter then replaces each x by 6x (x times the leading coefficient) to get(6x+4)(6x-3) = 0(c) Peter then simplifies this equation to get (3x+2)(2x-1) = 0, which solvesthe original equation.Prove or disprove that Peter’s method always works.
-
Algorithm
Bring out the importance of Algorithms in the field of Computer Science?
-
Validation of an Algorithm
What is validation of an algorithm?
-
Algorithm Profiling
What is meant by algorithm profiling?
-
Time Complexity
How to find time complexity?
-
Cyclic Directed Graph
What is the complexity of a algorithm of finding the Cyclic Directed Graph?
-
Algorithm Profiling
What is meant by algorithm profiling?
-
Prime Integer
Suggest two different methods of knowing if a given integer is prime and analyse them.
-
Importance of Algorithm
What is the importance of algorithms in the field of computer science?
-
Algorithm Characteristics
List out the characteristics of an algorithm
-
Advantages of Circular Queue
Bring out the advantages of circular queue over linear queue
-
Quicksort Algorithm
Demonstrate the quicksort algorithm to sort a list of data elements
Algorithm Questions
Ans