you can use a queue to make a bfs and store all nodes in the queue.
And then the sucessor is under control:)
On Mon, Jan 19, 2009 at 7:41 PM, sharad kumar wrote:
>
> could somebody pls tell me how to find bfs sucessor of a node in a
> tree (BST as well as binary)
> >
>
--~--~-~--~~--
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
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 <
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,...
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
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
>
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
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
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
how to post Q's to algogeeks??
--~--~-~--~~~---~--~~
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
al
Some can tell me how to implement Garwick's algorithm in java
and explaination of garwick's algorithm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algog
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
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
could somebody pls tell me how to find bfs sucessor of a node in a
tree (BST as well as binary)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@g
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 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
15 matches
Mail list logo