This of course depends on the processor, the compiler, and the
optimization settings you choose.
On some processors like x86, 2 might compile to slightly smaller code
because the decrement instruction instruction also sets the condition
codes, and the conditional branch can use this result. On th
http://lyle.smu.edu/~saad/courses/cse3358/ps5/problemset5sol.pdf
On Nov 24, 6:20 pm, MAC wrote:
> You are given a array with rows sorted and column sorted. You have to print
> entire array in sorted order .. any idea??
>
> --
> thanks
> --mac
--
You received this message because you are subscri
Process tree in the level order traversal, but instead queue you mau
use partially constructed list of nodes (which will be the exact
result).
Remember the first node of the (i-1)-th level in the list. Process
nodes and add its child. And so on.
On Nov 24, 6:35 pm, vamsee marpu wrote:
> Hi,
>
>
If BST is stored in an array, which is already in level order, then there is
nothing much remaining to do.
On Wed, Nov 24, 2010 at 9:05 PM, vamsee marpu wrote:
> Hi,
>
>
> Can anybody help me in solving the following problem:
>
>
> Convert a binary search tree in to a doubly linked list in level
you can use an algorithm similar to matrix chain multiplication i.e. if
dp[i][j] is the maximum value that you can get with the numbers v_i to v_j
and in order to maximize it find k that maximizes ( dp[i][k] op_k dp[k][j]
)
v_i is the ith value and op_k is the kth operator
obviously if i==j : dp
I think the compiler today can identify this optimization and thus the final
code will be the same.
You can check the assembly code generated by the gcc compiler for both the
loops.
On Wed, Nov 24, 2010 at 4:29 PM, shiva wrote:
> After googling i came to know that comparison with 0 takes less ti
Hi,
Can anybody help me in solving the following problem:
Convert a binary search tree in to a doubly linked list in level order
without using extra space :
BST
1
/ \
Merge Sort on rows??
On Wed, Nov 24, 2010 at 8:50 PM, MAC wrote:
> You are given a array with rows sorted and column sorted. You have to print
> entire array in sorted order .. any idea??
>
> --
> thanks
> --mac
>
> --
> You received this message because you are subscribed to the Google Groups
what does that mean??
On Wed, Nov 24, 2010 at 7:51 PM, k shivaprasad wrote:
> Hello Friends,
>
> Please let me know if you are working on Friday.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to
You are given a array with rows sorted and column sorted. You have to print
entire array in sorted order .. any idea??
--
thanks
--mac
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegrou
Hello Friends,
Please let me know if you are working on Friday.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubs
Hello Friends,
Please let me if you are working on Friday.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@
After googling i came to know that comparison with 0 takes less time
than comparing with some other number.So decremental loop is
fast(difference is very very low)
On Nov 22, 5:42 pm, rahul patil wrote:
> Might be its is due to the comparison operation which takes many cycles
>
> i < max takes mo
13 matches
Mail list logo