[algogeeks] Re: Is there any algorithm for checking whether two vetices are k-connected ?

2006-12-05 Thread Atamyrat Hezretguliyew
On 12/6/06, jackyy [EMAIL PROTECTED] wrote: Let G = (V,E) be a directed graph and s and t be two specific vertices in G. We say that s and t are k-connected if there are at least k edge-disjoint paths between s and t. Therefore, is there any algorithm to decide whether s and t are

[algogeeks] Re: My friend have a strange question, please help me to answer..

2006-12-05 Thread Atamyrat Hezretguliyew
On 12/6/06, jackyy [EMAIL PROTECTED] wrote: My friend has the following idea to get an algorithm for finding a shortest path tree on a graph whose edges may have negative length (but with no negative cycle): (i) Examine the edges and find the edge e with the most negative length. (ii) Add

[algogeeks] Re: Problem

2006-11-07 Thread Atamyrat Hezretguliyew
On 11/7/06, Malay Bag [EMAIL PROTECTED] wrote: I did not get the point:- we must calculate width and height of all of rectangles that can cover this 4 rectangles and it's area become minimum can you give some example? I think this problem is from IOI95

[algogeeks] Re: Nesting of comments in C

2006-09-29 Thread Atamyrat Hezretguliyew
#includestdio.h int main() { int allowed=1; /* /* */ allowed=0; // */ printf( allowed ? yes\n : no\n ); return 0; } Above code is not correct ANSI C code, but I think, you can compile it with most of compilers and check if it supports nested comments. For example, this code

[algogeeks] Re: Nesting of comments in C

2006-09-22 Thread Atamyrat Hezretguliyew
#includestdio.h void main() { int allowed=1; /* /* */ allowed=0; // */ printf( allowed ? yes : no ); } please correct me if there's smth i missed. atamyrat On 9/23/06, MM [EMAIL PROTECTED] wrote: How do you write a C program which when compiled and run, prints out a message indicating

[algogeeks] Re: Need an algorithm to find the missing numbers.

2006-08-24 Thread Atamyrat Hezretguliyew
On 8/24/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This is a very old problem in this group. The solution is simple. Here is an example {1,3} missing 2 1 XOR 3 XOR 1 XOR 2 XOR 3 = 2 Please note that you need to find missing numbers, not missing number.

[algogeeks] Re: Is there any better solution than 0(nlgn) ?

2006-08-04 Thread Atamyrat Hezretguliyew
On 8/4/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 1 #include stdio.h 2 3 int main() { 4 5 int A[] = {8,5,4,2,9}, B[] = {1,2,3,4,6}; 6 static int fo[10] ,i,ret = 0 ; /* max value is stored in A which is 9 7if we wouldn't know

[algogeeks] Re: Bubble breaker

2006-08-04 Thread Atamyrat Hezretguliyew
On 8/4/06, ridvansg [EMAIL PROTECTED] wrote: Hi, Lately I saw an interesting game and wonder is there a good algorithem to find the best solition. You have 5 type of bubbles in a matrix. You can select 2 or more neighboring bubbles with the same color and remove them. The bubbles are

[algogeeks] Re: Is there any better solution than 0(nlgn) ?

2006-08-02 Thread Atamyrat Hezretguliyew
On 8/1/06, sathiya narayanan [EMAIL PROTECTED] wrote: Given: 2 Arrays of N and M numbers in size. We have to find how many common numbers are available ? Eg: A={8,5,4,2,9} B={1,2,3,4,6) Solution is:2 Common elements are {2,4} What i wll do is Sort the array A and then do the

[algogeeks] Re: hi...one questions

2006-07-14 Thread Atamyrat Hezretguliyew
http://web.mit.edu/~mip/www/probs.html [12] Sorting by reversals (ONI'04) You are given an array A[1..N]. Your goal is to sort A by the following type of operation: pick some indices i,j and reverse the subarray A[i..j]. Such an operation costs j-i+1, i.e. the length of the portion which is