Page 1 of 1

11484 - Document Object Model

Posted: Sun Sep 14, 2008 9:42 pm
by sreejond
hello,
i need some critical i/o for this problem.
can anyone help me??
thanks in advance.

sreejon
cuet,06

Re: 11484 - Document Object Model

Posted: Mon Sep 15, 2008 4:03 am
by andmej
Try this one:

Code: Select all

6
<n value='parent'>
<n value='child'>
</n>
<n value='me'>
</n>
</n>
8
parent
parent
first_child
next_sibling
previous_sibling
previous_sibling
next_sibling
first_child

12
<n value='a'>
<n value='b'>
</n>
<n value='c'>
</n>
<n value='d'>
</n>
<n value='e'>
<n value='f'>
</n>
</n>
</n>
32
next_sibling
previous_sibling
first_child
parent
parent
first_child
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
first_child
previous_sibling
parent
parent
first_child
next_sibling
next_sibling
next_sibling
next_sibling
next_sibling
previous_sibling
next_sibling
first_child
previous_sibling
parent
parent

4
<n value='parent'>
<n value='child'>
</n>
</n>
6
next_sibling
first_child
first_child
parent
parent
parent

0

Correct output is:

Code: Select all

Case 1:
parent
parent
child
me
child
child
me
me
Case 2:
a
a
b
a
a
b
c
d
e
e
e
e
e
e
e
e
f
f
e
a
b
c
d
e
e
e
d
e
f
f
e
a
Case 3:
parent
child
child
parent
parent
parent

Re: 11484 - Document Object Model

Posted: Wed Jan 14, 2015 4:56 am
by brianfry713
The sample input is wrong.
It should be:

Code: Select all

4
<n value='parent'>
<n value='child'>
</n>
</n>
2
next_sibling
first_child
0