List out the characteristics of an algorithm
Latest Answer: should have the following five characteristics:1. Input2. Output3. Definiteness4. Effectiveness5. Termination ...
Bring out the importance of Algorithms in the field of Computer Science?
Latest Answer: In simple terms algorithms are a blue print and logic design for building functionality with programming languages. Write the algorithm..Validate the algorithm, check the characteristics of the algorithm before implementing the algorithm.Optimize the ...
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
Latest Answer: You can find de length of the side of square by using your procedure. but how can you find the position? ...
Give an algorithm that calculates the distance between two text strings (only operations you can have are: delete, add, and change, one by one).
Latest Answer: The distance of two strings, like "car" and "cat", is 1. So all we need to do is, compare two strings one character by one character and get the distance value. The complexity is O(max(m,n)), m, n are the length of each string. ...
Implement an algorithm that takes two strings as input, and returns the intersection of the two, with each letter represented at most once. Speed it up and test it.
Latest Answer: I think of an idea to do this by using a hash table. First, loop through first string, creat map, we can use ascii value of the char as the value. Only insert the char/int pair when a char can not be found in the hash table. After first ...
Given a1, a2, .... a(n) integers & M, return true or false if there exist a(x) + a(y) = MOnce you're done, do it using a hash table.
Latest Answer: a(x) + a(y) = MGiven a1, a2, .... a(n) integers & M, return true or false if there exist a(x) + a(y) = MOnce you're done, do it using a hash table.actually using a hash there is a better solution . you inititate the hash with all values from a. ...
Example : 1)m = 3,n = 2 a11 a12 a21 a22a31 a32Output : a11 a21 a12 a31 a22 a322) m = 3, n = 4a11 a12 a13 a14a21 a22 a23 a24a31 a32 a33 a34Output : a11 a21 a12 a31 a22 a13 a32 a23 a14 a33 a24 a34
Latest Answer: define two varibles initial_x and initial_y define another two varibles x and yint initial_x = m;int initial_y = n;while (x != m && y! =n){ print (x,y) x--; y++; // Traverse downwards first if (initial_x
What is the difference between instance(per object ) and static (shared by all objects) in report while declaring global variable?
Write an algorithm to find the minimum of numbers where N is any arbitary natural number. N is given to you by the user as the first value.
Latest Answer: Searching means finding whether the element is present in the list or not whereas sorting means Arranging the list in ascending or descending order. ...
View page << Previous 1 2 [3] 4 Next >>

Go Top