[algogeeks] Anna University MIT IT presents Samhita '11

2011-03-25 Thread Albert
Samhita '11


Samhita 2011 is a National Level Technical Symposium of Madras
Institute of Technology, Anna University, Chennai conducted by
Information Technology Association ITA of MIT campus. We welcome u all
for this technical symposium. Prices worth over 5 Lakhs to be won.
Admissions are open.So just participate in the battle of wits.




Venue: Chrompet,Chennai-44.

Date  : March 26,27.




Technical Events include  Algovasion (Onsite Coding contest), Bug Hunt
( Dubugging Contest) , Trick Snap (exploring windows and linux hidden
facts)and much more events.

For more details check out

 http://www.samhita11.com/samhita/

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Anna University MIT IT presents Samhita '11

2011-03-25 Thread albert theboss
*Samhita '11*


*Samhita 2011 is a National Level Technical Symposium of Madras Institute of
Technology, Anna University, Chennai conducted by Information Technology
Association ITA of MIT campus. We welcome u all for this technical
symposium. Prices worth over 5 Lakhs to be won. Admissions are open.So just
participate in the battle of wits.
*




*Venue*: *Chrompet,Chennai-44.*

Date  : *March 26,27*.


*

Technical Events include ** **Algovasion* *(Onsite Coding contest),* *Bug
Hunt** **( Dubugging Contest) , **Trick Snap* *(exploring windows and linux
hidden facts)and much more events.*

*For more details check out

 **http://www.samhita11.com/samhita/*

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Given an integer n , you have to print all the ways in which n can be represented as sum of positive integers

2011-03-15 Thread albert theboss
@bittu : many over lapping sub problems available in ur case ... better try
dp to get the efficient solution...
@all : suggest algo for the case without repetition.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Search element in 2D row-wise colum-wise sorted matrix

2011-03-05 Thread albert theboss
the quadinary search will work well for this problem...


step 1 : divide the matrix into 4 almost equal quadrands

step 2 : being row wise sorted and column wise sorted the smallest value
will be at the top left and largest value will be at the bottom right... if
the value to be searched is within the range between largest and smallest
recursively perform step 1 until 2x2 matrix 

step 3: if it 2X2 matrix search the element individually..

complexity of this algorithm will be log4(n*m),

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Good question

2011-02-06 Thread albert theboss
using this macro

size(X)  ((X*)0+1)



if we give size(int)  it ll return 4.
size(double)  gives 8.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Excel Sheet Question Asked

2011-02-01 Thread albert theboss
yes yes i forgot to say

when n is 26 we ll get (26)0 ie A0

so wen u encounter 0 u need to borrow one which ll become 26 for the
borrower number from previous number

so it ll become 0Z.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Excel Sheet Question Asked

2011-02-01 Thread albert theboss
Simply L division by 26 gives the answer ...
like decimal to binary conversion thats it

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] regarding output

2010-10-13 Thread albert theboss
p[b] is equivalent to *(p+b)

here p is converted to the void pointer pointing to address location 0x0003

then the pointer value is added by the offset b which is 8 here .

8+3 giving 11


this is one of the method of finding the sum of two numbers without using
addition operator

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Find push/pop/min or max in O(1)

2010-09-29 Thread albert theboss
when we pop out something 
we need to find the max min again if max or min is popped out...
this ll take again O(n) to find max and min

Correct me if am wrong

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Iterative Quick sort

2010-09-27 Thread Albert
Hi can any one suggest an efficient algorithm for iterative quick
sort


Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: ReVerse a string using recursion

2010-09-25 Thread albert theboss
please let me know solution using extra memory.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: ReVerse a string using recursion

2010-09-24 Thread albert theboss
sorry i dont know the solution.
i just expecting such answer

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: ReVerse a string using recursion

2010-09-24 Thread albert theboss
@nishanth :
 could u give me any solutions without global variable or static
variable

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] ReVerse a string using recursion

2010-09-23 Thread albert theboss
Ur function prototype is not similar to one i posted before

check it out

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] ReVerse a string using recursion

2010-09-23 Thread Albert
How to reverse a String using recursion in C without using any extra
memory?

the question seems to be simple.

char* strrev(char *)
{
...
...
...
}


Try to give all the answers for this prototype.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Number problem

2010-09-21 Thread Albert
Given a number find the number by eliminating the duplicate digits in
the number..

for eg:   24526  ans is 2456
.


int function(int n)
{

 .
 .
 .

}

Give all sort of solutions to this problem.

Efficiency in the code is important 

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Recursion!!!!!!!!!!! Always Stuck

2010-09-09 Thread albert theboss
Its easy only 

tower of hanoi consist of three pegs peg A,peg B,peg C.
which is used as BEG,AUX,END

Let n be 5 for example...

wat u r going to do is

step 1 : move the top n-1 (4) disks from BEG to  AUX...
 in this case END will be used as auxiliary.

step 2:  move the n th disk from BEG to END .
use AUX as auxiliary in this case

step 3: move the  n-1(4) disks from AUX to END that is moved in step 1
 use BEG as auxiliary in this step


Actual code is

 void tower(int n,char beg,char aux,char end)
{
   if(n>0)
{
  tower(n-1,beg,end,aux);   //  move n-1 disks from beg to
aux
   printf("%c->%c",beg,aux,end);//equivalent to
tower(1,beg,aux,end)move 1 disk from beg to end
   tower(n-1,aux,beg,end)  //   move disks from aux to end
}
}

   again that n-1 disks are moved to end which is called recursively.

Still u have doubt???

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: how we can access 2nd element of an struct

2010-09-07 Thread albert theboss
typedef struct list node;

node a;

(float*)((char*)a+2)

is it correct ??
correct me i am wrong

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: fork() problem

2010-09-04 Thread albert theboss
@prem:
 Could u explain please ???
 in the end of second line of main how many processes are created???

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Simple reVerse

2010-09-04 Thread albert theboss
@shravan:
can u do with bitwise operator???
something wat "dave" is trying...

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Simple reVerse

2010-09-04 Thread albert theboss
@dave : still i am getting wrong answer...
 could u please re check the answer and post it

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Simple reVerse

2010-09-04 Thread albert theboss
@discover:

void stringreverse(char *temp,i,j)
{
  if(i>j)
   return;
  swap(temp[i],temp[j]);
  i++;
  j--;
  stringreverse(temp,i,j);
  return ;
}

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Simple reVerse

2010-09-03 Thread albert theboss
if input is 12345
then the output should be 54321

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Simple reVerse

2010-09-03 Thread albert theboss
@Dave but i tried the code its not working 

  Its giving 1 for all the input

  could u explain the code please 

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Simple reVerse

2010-09-03 Thread Albert
int reverse(int x)
{

...
...


}

complete the above code such that it returns the reverse of 'x' 

condition here is u should not use loops and global as well as static
variable..

try to give all the possible solutions for this  ...

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Could anyone explain how this code works?????????!!!!

2010-08-31 Thread Albert
#include
main()
{
int a,b,c;
int count = 1;
for (b=c=10;a="- FIGURE?, UMKC,XYZHello Folks,\
TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\
NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\
HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\
T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\
Hq!WFs XDt!" [b+++21]; )
for(; a-- > 64 ; )
putchar ( ++c=='Z' ? c = c/ 9:33^b&1);
return 0;
}

It just contains two for loop but i cant understand the how it is
working???

help me please.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Binary tree to LL

2010-08-29 Thread albert theboss
@Chonku:

you cant use "next" pointer in that...

you have to make link list such that right ptr points to next node

and left pointer to prev node

Am i right???
correct me if i am wrong.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Deciding on a project

2009-05-25 Thread Albert

Miroslav Balaz wrote:
> you should register on  www.topcoder.com!!!
> and according to your skill you should try  to solve some problems 
> fromhttp://www.spoj.pl/or acm.sgu.ru

Okay, but I'd like an idea of real-world programming and not just
trying to solve hard problems under timed conditions. Any ideas?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] Deciding on a project

2009-05-24 Thread Albert

Hi,

I'm 15 years old and I'm interested in algorithms, data structures,
computational geometry and general coding. What sort of projects could
I do in my spare time that fuels my interests and is something I can
go on with? Other than competing in USACO...

Thanks
Albert

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] Re: Is it base 2 or base 10

2008-05-20 Thread Albert Sanchez
when talking assimpotically it doesn't really matter what base is, as
log_a(x) = log_b(x) * 1/log_b(a) and 1/log_b(a) is constant

On Thu, May 15, 2008 at 1:52 PM, amitabh chauhan <[EMAIL PROTECTED]>
wrote:

> actually base do not matters base 2 and base 10 are constant multiple of
> each other so complexity remains same ( ya constant multiple do change )...
> but its base 2 most often...
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] Re: Plannar graph

2008-04-03 Thread Albert Sanchez
There are some conditions a planar graph must fulfil:

- Every planar graph is sparse.
- E <= 3V - 6.
- Degree of a vertex is at most 5.
- Every subgraph of a planar graph is, of course, planar. There's always a
sequence of low-degree vertices whose deletion eventually leaves the empty
graph.

hope this help ;)


OuFeRRaT



On Mon, Mar 17, 2008 at 10:38 AM, sp1 <[EMAIL PROTECTED]> wrote:

>
> How to test an given graph is plannar?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] Re: permuttaion

2008-02-21 Thread Albert Sanchez
Can you explain what do you want exactly?

- Finding all the permutation of the numbers?
- Finding a random permutation?
- Finding the next lexicographical permutation?
- Finding the ith permutation?

Are there repeated numbers?

OuFeRRaT


On Thu, Feb 21, 2008 at 12:44 PM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:

>
> hi,
>
> can some one help me in writing an algorithm for finding permuttaion
> of 'n' numbers??..i have tried it many times.but not getting it...can
> anyone help me..
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] road traffic

2008-01-24 Thread Albert Sanchez
Hi,

Anyone interested in "road traffic" strategies? Flow optimization, time
dependent shortest paths problems?



Albert

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] Re: c++ STL ,need help

2007-09-28 Thread Albert Sanchez
can u explain more ur question please?

On 9/12/07, mirchi <[EMAIL PROTECTED]> wrote:
>
>
> can someone please tell me how to use the same vector for multiple
> inputs...?
> its urgent !
>
>
> >
>


-- 
OuFeRRaT
http://ouferrat.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] Chained Pawns

2007-09-28 Thread Albert Sanchez
This is a problem from a training contest of the UPC Programming
Conest<http://concurs.lsi.upc.edu/>
.

I have been thinking of it a lot and I can't find the solution.

Any ideas?

  In the game of chess, a pawn is a piece that only threatens two squares,
namely the two diagonally in front of it (if these squares exist). For
instance, in this example board with five rows and seven columns, the pawn
at c4 threatens b3 and d3, the pawn at a2 only threatens b1, the pawn at g5
only threatens f4, and the pawn at e1 threatens no square. (In a real chess
game no pawn can appear at the first or last row, but we forget that rule
here.)

Now, given the number of rows *R* and the number of columns *C* of the
board, can you compute *Pawns(R, C)*, the number of ways to place *R* pawns
in the board such that all the pawns but one threatens exactly another pawn
and all the pawns but one is threatened exactly by another pawn?
InputEach line of input has two integers *R* (1 ≤ *R* ≤ 50) and *C* (1
≤ *C*≤ 50) with the dimensions of the board.
OutputFor each input line, print a line with *R*, *C* and *Pawns(R, C)*. You
can assume that the decimal representation of *Pawns(R, C)* requires less
than 18 digits. Sample Input

1 9
4 2
5 7

Sample Output

1 9 9
4 2 2
5 7 74

*Author:* Salvador Roura





Thanks,

Albert

-- 
OuFeRRaT
http://ouferrat.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---

<>

[algogeeks] Re: Algo to get GCD of given numbers

2007-08-24 Thread Albert Sanchez
int gcd(int a, int b) { return (b==0 ? a : gcd(b,a%b)); }

http://en.wikipedia.org/wiki/Euclidean_algorithm

On 8/17/07, Muntasir Azam Khan <[EMAIL PROTECTED]> wrote:
>
>
> On Aug 17, 6:53 pm, anshu <[EMAIL PROTECTED]> wrote:
> > Do you think sorting would help here?
> > I mean, arranging the numbers in descending order and then computing
> > progressively.
> >
> > Why I am suggesting sorting is that considering an array like the
> > following
> > 2, 80, 36, 70, 150, 300
> > It would be pretty expensive to do the euclidean algo first with
> > gcd(2, 80 ) = 2  --- O(40)
> > gcd(2, 36 )= 2 -- O(18)
> > gcd(2 , 70)  =
> > gcd(2, 150)
> >
> > vs
> > gcd(150, 300) =  150
> > gcd(70,150) = 10
> > etc..
>
> I don't know, but this is easily found by running tests on sorted vs
> unsorted input.
> I don't think this really matters much, unless you are using really
> big numbers, and even then I am not sure.
>
> Muntasir
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] Re: Find largest sum

2007-08-24 Thread Albert Sanchez
what is the DP recurrence?

On 8/23/07, ilija <[EMAIL PROTECTED]> wrote:
>
>
> If the subarray needs to be continuous, then you can do it using DP.
> If it doesn't, you can do it using an O(n) algo - simply sum all the
> positive integers.
>
> On 22 kol, 19:55, Ravi <[EMAIL PROTECTED]> wrote:
> > You're given an array containing both positive and negative integers
> > and required to find the subarray with the largest sum.
> > Write a routine in C for the above.
>
>
> >
>


-- 
OuFeRRaT
http://ouferrat.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---