emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lists.texi


From: David Kastrup
Subject: Re: lists.texi
Date: Sun, 19 Jun 2005 08:37:51 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Luc Teirlinck <address@hidden> writes:

> Actually, if we have to do all of that to get the correct return
> value, we could quite as well use the following function, which does
> get the order correct:
>
> (defun ring-elements (ring)
>   "Return a list of the elements of RING in order, newest first."
>   (let (lst)
>     (dotimes (var (ring-length ring))
>       (push (ring-ref ring var) lst))
>     (nreverse lst)))

Looks like O(n^2) complexity to me.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]