[Top][All Lists]

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

Re: [Chicken-users] Two dimensional linked lists

From: Justin Ethier
Subject: Re: [Chicken-users] Two dimensional linked lists
Date: Thu, 8 Sep 2016 21:21:40 -0400

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:

This example is in Python but you get the idea:



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

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

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?



Chicken-users mailing list

reply via email to

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