Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: Immutable Datastructures with good Sharing Date: Sat, 05 Nov 2011 22:50:05 +0100 Organization: albasani.net Lines: 21 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net ldO1EoAdtrzA4fYFwVsP+pANjZfuZtgKEY0MaxjJIq4CAmWVmZbupxH7BghgnWOgzk2Kz7TuEYyUkRy6bWRNeg== NNTP-Posting-Date: Sat, 5 Nov 2011 21:50:05 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="krUrN4zYbwgH7TqInISgoNLd0tPasp5io2FR9KL5q/ET7q89rxZF01wDocZmFnm2TZTrWUv6UF72FYnnJ1sykuZ7Sh7rZ5supkrlTzFWvkCId08Veh94CBTH3tnyV+Im"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110928 Firefox/7.0.1 SeaMonkey/2.4.1 In-Reply-To: Cancel-Lock: sha1:K1mGhFVxuEvOJqlFyD8/yf7hRGw= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9620 Jan Burse schrieb: > So I guess we did not yet find a solution. > > Bye > > But he has a second solution: This looks as follows: ---- 1. stack --- | --- 2. stack (shown reverse) --- ^ pop here = dequeue enqueue = push here ^ Then he argues that we have in the average O(1), although when 1. stack gets empty, 2. stack needs to be reverse. Interesting, cool! Bye