> This is a very old technique for representing queues in functional
> languages where you have no assignment. It's called immutable because
> pointers are never changed once they're set.
Gene, thanks a lot for your reply. I'm not sure if I understand what
pointers we're talking about; are they
Prundhaban's solution works fine. But how to handle duplicates and how to bring it down to nLogn.
Gene's solution also works fine. But this will also be n^2. since we have to scan back to get the upper and lower bound. for each element i, we have to go through all the elements and get the lower
Hi, A similar but straightfoward O(n^2) solution ;-) For each element a[i], traverse on either side of the array with a[i] as the pivot until you reach elements a[j]This solution differs from Gene's in that, it doesn't select the minimum element each time as i thought it would take more tim
Hi Pradeep,
I don't think a DP will work... (unless it is single dimensional DP)...
My idea was on the same lines of Gene... But I was thinking about an easy implementation which runs in O(n log n) on average case... (Of course... in worst case it takes... O(n^2)... But... why not give it a try
adityar7 wrote:
> Hi,
>
> Recently I found an algorithm for creating a Queue datatype whose
> objects are immutable. Basically, the algorithm is as follows:
>
> class ImmutableQueue {
> // Assume we know how to create immutable lists
> ImmutableList back;
> ImmutableList front;
> ...
> }
>
Pradeep Muthukrishnan wrote:
> I have been trying this problem for quite some time now...but havent
> found anything concrete...can anyone solve this?
> http://acm.zju.edu.cn/show_problem.php?pid=2642
Hello Pradeep. Here is an idea.
I am going to write [a..b] for a potential solution range with
(top of my head) I would keep the minimum and the sum for each interval, and just calculate the max of the sum times the minimum for each interval (the trick is store the minimum of each interval to avoid O(n) searches each time you calculate the max)
sorry for the quick response... must go on w
Hello da404LewZer,Thank you for the coderwiki.com link. I think it is a very good use of wiki-style web sites. Hopefully, it will be popular enough to continuously grow.
I would like to see future messages from you on this issue.-- With all the best wishes,CratimaCratima Software and Cratima Intera
hi
friends
the solution given Googmeister is not correct pls
check
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@goo
hey
can u explain the meaning of immutble queue .
--~--~-~--~~~---~--~~
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 g
can u please explain the recurrence? I have been thinking abt DP but
could never find a recurrence
On 6/26/06, Guillermo Garcia <[EMAIL PROTECTED]> wrote:
> Try dynamic programming
>
>
>
> On 6/26/06, Pradeep Muthukrishnan <[EMAIL PROTECTED]> wrote:
> >
> > I have been trying this problem for qui
Try dynamic programming
On 6/26/06, Pradeep Muthukrishnan <[EMAIL PROTECTED]> wrote:
I have been trying this problem for quite some time now...but haventfound anything concrete...can anyone solve this?
http://acm.zju.edu.cn/show_problem.php?pid=2642
--~--~-~--~~~---~--~
Thomas.Chang wrote:
> Thanks for you reply.
> Yes, I can use the qsort() in standard c library to finish my work. But
> what I want to know is why I was wrong. Qsort is a great, because it
> shortens the sorting time from O(n^2) to O(nlogn). But I want to know
> if I am thinking the wrong way aga
Thanks for you reply.
Yes, I can use the qsort() in standard c library to finish my work. But
what I want to know is why I was wrong. Qsort is a great, because it
shortens the sorting time from O(n^2) to O(nlogn). But I want to know
if I am thinking the wrong way against the discoverer's.
The "i++
I have been trying this problem for quite some time now...but havent
found anything concrete...can anyone solve this?
http://acm.zju.edu.cn/show_problem.php?pid=2642
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"A
15 matches
Mail list logo