What is the importance of algorithms in the field of computer science?
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
Latest Answer: Take two pointers P1 and P2.Initially let P1 and P2 point to starting node (S) and set counter to zero.increment the counterthen check while(1) {if p1 == p2 ->next{ print the counter value this is the node where circle starts. ...
What is the complexity of a algorithm of finding the Cyclic Directed Graph?
Latest Answer: use BFS or DFS time complexity is O(V+E) ...
Write an algorithm that calculates all the elements of rows and columns of a square matrix and calculate the total of primary and secondary diagonal.
How many values can be held by an array with dimensions A(0:n), B(-1:n,1:m), C(-n:0,2)?
Latest Answer: A(0:n) = n+1 elements-1 specifies that the array indexing starts at '-1' uptill 'n'. Therefore, there can be "n-(-1)+1 = n+2" rows in the array. Each of this row may hold upto m (m-1+1) elements. Therefore, B(-1:n, 1:m) = (n+2)*(m) ...
How to find time complixity?
You are given a matrix. The matrix elements are such that they are sorted both horizontally and vertically. Given an element of the matrix, your job is to obtain its position in an efficient manner.Example:
Latest Answer: I'm assuming the matrix is NxM (not necessarily square) and there are no duplicate values (otherwise the search should return multiple results).So that said, you can do the following:1) go to the "center" of the matrix (dividing it in 4 ...
You have an array of size '2n' of these, 'n+1' elements are distinct and 1 element is repeated 'n' times. You must find the repeated element and say how many times it has
Latest Answer: The number of times the element is repeated is known. No? It is 'n'. Given that info you find the product of all the numbers say 'P'. Now find the largest number say x in the array such that P is divisible by x^n. ...
What is meant by algorithm profiling?
Latest Answer: In recent years, several very efficient exact optimization algorithms have
been developed in the computer science community. Examples are maximum flow
algorithms, minimum-cost flow techniques, matching methods, which all are graph
theoretical approaches ...
What is validation of an algorithm?
Latest Answer: The process of measuring the effectiveness of an algorithm before it is coded to know the algorithm is correct for every possible input.This process is called validation. ...
View page << Previous 1 [2] 3 4 Next >>

Go Top