chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Two dimensional linked lists


From: Kristian Lein-Mathisen
Subject: Re: [Chicken-users] Two dimensional linked lists
Date: Sun, 11 Sep 2016 23:49:40 +0200


Hi mfv,

I'm not sure this will help you but I just put up a egg I made for myself that might be useful to you in this context.

https://gist.github.com/kristianlm/9d7e5c1bdae8c443c7deb676d6f4a7d0

Maybe the vector-grid procedure might be of use.
K.

On Fri, Sep 9, 2016 at 3:21 AM, Justin Ethier <address@hidden> wrote:
A vector of vectors would be more efficient to traverse for large values of [n], but if the vectors are not the same length you need to check to make sure index [n] exists in each one. If you are going to handle random insertions of data you also have to worry about growing a vector(s) if the requested [n] is larger than the vector size.

A simple and elegant (though perhaps not the most efficient?) solution is to use a hashtable to store the cell values:
https://wiki.call-cc.org/man/4/Unit%20srfi-69

This example is in Python but you get the idea:
http://code.activestate.com/recipes/355045-spreadsheet/

Thanks,

Justin


On Thu, Sep 8, 2016 at 7:07 AM, mfv <address@hidden> wrote:
Hi,

what would be the best way to implement two dimensional linked lists into
Scheme? I was thinking about fooling around with spreadsheet calculations in
Scheme, but it seems to me tha there are not proper data structures for it
here.

As I understand, making linked lists from linked lists will create a
structure that can not be traverse efficiently in all directions:

With the structure being

        (list (list-A) (list-B) (...) (list-Z) (list-AA))

it would be trivial to quick to traverse from A[0] to A[n], but long to
get to A[n] to B[n].

Would the same thing apply to vectors?

Regards,

   mfv



_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users


_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users



reply via email to

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