Interogation about recursivity or sequential

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Interogation about recursivity or sequential

Yann Dubois
Hello World, Happy new year 2016 !

I actually work on an integration of a double linked list on Pharo and I have a little interogation.
It's better to use recursivity or senquential algorithm ?

Yann
Reply | Threaded
Open this post in threaded view
|

Re: Interogation about recursivity or sequential

Sven Van Caekenberghe-2
Hi Yann,

> On 04 Jan 2016, at 22:11, Yann Dubois <[hidden email]> wrote:
>
> Hello World, Happy new year 2016 !

And to you too.

> I actually work on an integration of a double linked list on Pharo and I have a little interogation.
> It's better to use recursivity or senquential algorithm ?

Recursive is often cleaner, sequential is often faster.

> Yann

There is already a (minimal) DoubleLinkedList in the image ...

Sven
Reply | Threaded
Open this post in threaded view
|

Re: Interogation about recursivity or sequential

Peter Uhnak
Wouldn't it be better to improve the current (Double)LinkedList instead of creating new ones? DLL had some improvements recently and I am not aware that it's missing something.

On Mon, Jan 4, 2016 at 10:34 PM, Sven Van Caekenberghe <[hidden email]> wrote:
Hi Yann,

> On 04 Jan 2016, at 22:11, Yann Dubois <[hidden email]> wrote:
>
> Hello World, Happy new year 2016 !

And to you too.

> I actually work on an integration of a double linked list on Pharo and I have a little interogation.
> It's better to use recursivity or senquential algorithm ?

Recursive is often cleaner, sequential is often faster.

> Yann

There is already a (minimal) DoubleLinkedList in the image ...

Sven

Reply | Threaded
Open this post in threaded view
|

Re: Interogation about recursivity or sequential

abergel
In reply to this post by Yann Dubois
Recursivity is usually better to read, understand. However sequential is usually more efficient (but harder to implement right).

Cheers,
Alexandre

> On Jan 4, 2016, at 6:11 PM, Yann Dubois <[hidden email]> wrote:
>
> Hello World, Happy new year 2016 !
>
> I actually work on an integration of a double linked list on Pharo and I have a little interogation.
> It's better to use recursivity or senquential algorithm ?
>
> Yann

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: Interogation about recursivity or sequential

stepharo
In reply to this post by Peter Uhnak
I propose this as an exercise.
Now I was not aware that we have doubleLinkedList in the system.

I do not get why DoubleLinkedList is packaged in System-Caching and not Collections-DoubleLinkedList?
    https://pharo.fogbugz.com/f/cases/17360/DoubleLinkedList-should-be-packaged-in-Collections-DoubleLinkedList   
Stef


Le 5/1/16 02:50, Peter Uhnák a écrit :
Wouldn't it be better to improve the current (Double)LinkedList instead of creating new ones? DLL had some improvements recently and I am not aware that it's missing something.

On Mon, Jan 4, 2016 at 10:34 PM, Sven Van Caekenberghe <[hidden email]> wrote:
Hi Yann,

> On 04 Jan 2016, at 22:11, Yann Dubois <[hidden email]> wrote:
>
> Hello World, Happy new year 2016 !

And to you too.

> I actually work on an integration of a double linked list on Pharo and I have a little interogation.
> It's better to use recursivity or senquential algorithm ?

Recursive is often cleaner, sequential is often faster.

> Yann

There is already a (minimal) DoubleLinkedList in the image ...

Sven