[algogeeks] Re: Pyramid algorithm?

2009-01-20 Thread Coskun Gunduz
you're right, the definition is "Say you have a collection of stackable objects, like blocks or boxes. You need to stack them in a pyramid as tall as possible, so that no more than 1-2 of the objects is at the top level, and so that each layer is *larger than the first*," probably it should be *l

[algogeeks] Re: Pyramid algorithm?

2009-01-19 Thread Miroslav Balaz
so 1-2 = -1 so there should be at most negative number of items on top layer Ok, thats a Joke but seriously top layer :o other layers:oo other layers:oo other layers:oo other layers:oo other layers:oo first layer:o so it is o oo oo oo oo oo o it maximizes the height. 2009/1/19 Darth Continent

[algogeeks] Re: Pyramid algorithm?

2009-01-19 Thread Coskun Gunduz
hey almost the same LOL. you type faster than me :) On Mon, Jan 19, 2009 at 5:01 PM, Karthik Singaram Lakshmanan < karthiksinga...@gmail.com> wrote: > > Well. I would suggest the following. > If n is the number of stackable objects, > You could compute the largest value of x such that x*(x+1)/2 <

[algogeeks] Re: Pyramid algorithm?

2009-01-19 Thread Coskun Gunduz
OK, here's my algorithm: Let n be the number of stacks. start from 1 and begin making the levels, stop at m where n-((m-1)*m/2)<=m. Put the stacks left to the level m-1. here's the idea: number of stacks for each level is, starting from 1 and increase by 1 at each step. So, it goes as, 1,2,3,...

[algogeeks] Re: Pyramid algorithm?

2009-01-19 Thread Karthik Singaram Lakshmanan
Well. I would suggest the following. If n is the number of stackable objects, You could compute the largest value of x such that x*(x+1)/2 <= n Then you can arrange the objects as O OO OOO O..O (x objects) Now the remaining can be placed in the last row. Without violating the constraints this

[algogeeks] Re: Pyramid algorithm?

2009-01-19 Thread Darth Continent
Are you on something...? Not on TO something but ON something?? No more than 1-2 of the objects at the TOP level, and each layer is LARGER than the first. On Jan 19, 7:16 am, "Miroslav Balaz" wrote: > LOL, according to your definition , pyramid would look like this > o > oo > oo > oo > oo >

[algogeeks] Re: Pyramid algorithm?

2009-01-19 Thread Darth Continent
That's an algorithm?? On Jan 19, 7:46 am, "Coskun Gunduz" wrote: > 1 > 2 > 4 > > I guess. > > coskun... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to

[algogeeks] Re: Pyramid algorithm?

2009-01-19 Thread Darth Continent
O OO On Jan 19, 7:29 am, "manoj janoti" wrote: > Just want to know what will be the structure if the number of stackable > objects is 7 > > ~Janoti --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algorithm

[algogeeks] Re: Pyramid algorithm?

2009-01-19 Thread Coskun Gunduz
1 2 4 I guess. coskun... On Mon, Jan 19, 2009 at 2:29 PM, manoj janoti wrote: > Just want to know what will be the structure if the number of stackable > objects is 7 > > ~Janoti > > > On Mon, Jan 19, 2009 at 11:17 AM, Darth Continent < > darthcontin...@gmail.com> wrote: > >> >> Hello, when I

[algogeeks] Re: Pyramid algorithm?

2009-01-19 Thread manoj janoti
Just want to know what will be the structure if the number of stackable objects is 7 ~Janoti On Mon, Jan 19, 2009 at 11:17 AM, Darth Continent wrote: > > Hello, when I searched I found a couple of spam posts for pyramid > scams, so I'm hoping someone may be able to help. > > Say you have a colle

[algogeeks] Re: Pyramid algorithm?

2009-01-19 Thread Miroslav Balaz
LOL, according to your definition , pyramid would look like this o oo oo oo oo oo oo oo oo 2009/1/19 Darth Continent > > Hello, when I searched I found a couple of spam posts for pyramid > scams, so I'm hoping someone may be able to help. > > Say you have a collection of stackable objects, like