You are viewing a single comment's thread. Return to all comments →
Hi, the submission code takes about 16 seconds on my machine and profiling shows almost all the time goes to the down function. The file input23.txt has one million 1 values. I did not look at the code or debug it, but an idea is maybe what is happening is your down function should be stopping at the root because arr==arr==arr, but instead propagates identical values from the root all the way to the leaf?
I was unable to find out why it was timeout ,eventhough its correct for arr==arr==arr
What was the reason for the timeout?
Can you explain what the fact that the root has same values as his children tells you about the rest of the heap?