11071 - Permutation Representation

All about problems in Volume 110. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel » Fri Aug 25, 2006 9:30 pm

When I said heap I only meant using the idea that a node with index i has one child at index 2 * i, and the other at 2 * i + 1.
So a binary tree can be represented in an integer array without the need of using left or right pointers.

StatujaLeha
Learning poster
Posts: 91
Joined: Tue May 31, 2005 2:01 pm
Location: Russia

Post by StatujaLeha » Fri Aug 25, 2006 10:02 pm

Adrian Kuegel wrote:When I said heap I only meant using the idea that a node with index i has one child at index 2 * i, and the other at 2 * i + 1.
So a binary tree can be represented in an integer array without the need of using left or right pointers.
mmm... I tried to use this implementation, but got RTE. After I changed heap for binary tree, I got Accepted.

spiker
New poster
Posts: 1
Joined: Sun Jul 04, 2010 11:12 am

Re: 11071 - Permutation Representation

Post by spiker » Mon Aug 09, 2010 4:35 pm

Can anyone explain the solution, which was post here?
I don't understand the main idea of this solution.
Can someone show the solution on the small input?

Post Reply

Return to “Volume 110 (11000-11099)”