-
Finding a 'circle' in a linked list
You have n numbrer Node objects - could be 1,000,000 for all you know. Each Node has a getNext() method that returns the next Node (a linked list).But the chain of n number of Node objects linked together by the getNext() method, somewhere in the chain, points back to a Node earlier in the chain so if you keep calling getNext() to walk the chain you will never get to the last Node - it will loop forever.What...
-
-
Sub matrix
U are given a n*n square matrix where each element is either 0 or 1....u have to find the square submatrix with the largest length such that all the elements along the border of that square submatrix matrix is 1 ....
-
Characteristics of an Algorithm
List out the characteristics of an algorithm
-
Post Order Binary Tree Traverse
Design a conventional iterative algorithm to traverse a binary tree represented in two dimensional array in postorder.
-
Read the heights in inches and wieght in pounds
Read the heights in inches and wieght in pounds of an individual and compute and print their BMI=((weight/height)/height)*703
-
A car rental firm leases its cars for $250 per day.
A car rental firm leases its cars for $250 per day. The manager gives a discount based on the number of days that the car is rented. If the rental period is greater than or equal to 7 days then a 25% discount is given. Read the period and print the discount given
Compute Average of Two Scores
Describe an algorithm to compute the average of two scores obtained by each of the 100 students
Compute the sum of integers Algorithm
Write an algorithm to compute the sum of integers from 1 to 50 ? please write the answer in descriptive way to solve this ?
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?
Ans