Re: Lists, Arrays and Vectors [was Re: [Gimp-developer] Re: Tiny-Fu: A new plug-in for GIMP]

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

 



At 05:17 AM 07/07/2004, Shlomi Fish wrote:
Are you sure using lists instead of vectors is the right thing to do? Lists
are linked lists and as such accessing the i'th element is O(i). In vectors
it is O(1). This can cause an order of complexity increase in handling them.

No, I'm not sure. For the few scripts I looked at (and for ease of implementation), using a list was the easier route to have something functional during the early development stages. Using vectors instead of a simple list would mean the ability to use functions which would provide rough equivalents to the SIOD interpreters array manipulation functions.


In any case, this may not be an issue, because a programmer can temporarily
use a vector, and convert it to a list before calling the PDB entries.

Conversion is simple through the use of vector->list and list->vector.

I will take a closer look at using vectors. It will simplify the work needed to update old Script-Fu scripts for use with Tiny-Fu. I will start by converting between list and vector. If the approach works well, I will bit the bullet and update the marshalling code to use vectors for the *ARRAY types.


Cheers!

Kevin.  (http://www.interlog.com/~kcozens/)

Owner of Elecraft K2 #2172        |"What are we going to do today, Borg?"
E-mail:kcozens at interlog dot com|"Same thing we always do, Pinkutus:
Packet:ve3syb@ve3yra.#con.on.ca.na|  Try to assimilate the world!"
#include <disclaimer/favourite>   |              -Pinkutus & the Borg


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux