Series: Subject: Topic:

# Algorithm Questions

Showing Questions 41 - 51 of 51 Questions
First | Prev | | Next | Last Page
Sort by:
|

How can you traverse a matrix of m lines and n columns in a zig-zag way ?

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

Answered by: charlypa on: Jun 19th, 2009

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 downwar...

Answered by: guitarfox on: Jun 19th, 2008

My answer is similiar to Ashish.Shekhar 's.#include <cstdlib>#include <iostream>using namespace std;int main(int argc, char *argv[]){    int m, n;    cout...

Cyclic directed graph

What is the complexity of a algorithm of finding the cyclic directed graph?

Answered by: charlypa on: Jun 19th, 2009

use BFS or DFS time complexity is O(V+E)

Characteristics of an algorithm

List out the characteristics of an algorithm

Answered by: osoriri2004 on: Dec 20th, 2008

should have the following five characteristics:

1. Input
2. Output
3. Definiteness
4. Effectiveness
5. Termination

Validation of an algorithm

What is validation of an algorithm?

Answered by: osoriri2004 on: Dec 20th, 2008

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.

Algorithm profiling

What is meant by algorithm profiling?

Answered by: gautam958 on: Sep 12th, 2008

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, mat...

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 ....

Answered by: revcs2k546 on: Aug 19th, 2008

You can find de length of the side of square by using your procedure. but how can you find the position?

Answered by: cyrano_says on: Jul 26th, 2008

You go through one element at a time and figure out whats the maximum lenght along one side that has all 1's. Eg starting with (1,1). Keep looking along the vertical. (1,2),(1,3)....Once you hit a...

Algorithm

Bring out the importance of algorithms in the field of computer science?

Answered by: vkumbaji on: Jun 16th, 2009

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 algori...

A(x) + a(y) = m

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.

Answered by: guitarfox on: Jun 19th, 2008

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 solut...

Answered by: tashageek on: Jun 7th, 2008

actually using a hash there is a better solution . you inititate the hash with all values from a. and then you go over a again and check if the complementry of a[j] ie M-a[j] is in the hash. this way the complexity is O(n) and not O(M+n)

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,...

Answered by: raviji on: Dec 16th, 2007

Answer is 1188 for total trees, so that lost trees are 297 and trees still left are 891.

Peter is always correct since he is merely multiplying whole equation by the leading coefficient.

Val is a well-known 1. Real-time language 2. Object-oriented language 3. Command language 4. Data-flow language

Answered by: Anchal Jain on: Aug 28th, 2007

Val is a well known Data Flow Language used for transactions.

What optimizations on usb stack for the improving the performance

First | Prev | | Next | Last Page