Linked Lists, Dynamic Arrays and Hash Tables

Started by Peter_R, May 25, 2012, 03:09:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Would you be interested in library code for these data structures?

Yes
7 (100%)
No
0 (0%)
Depends on something (please post details)
0 (0%)

Total Members Voted: 7

Peter_R

Hi, I'm new here so I apologise in advance if this isn't the right place for this post.

I've used Fenix before and have looked at BennuGD but have never really implemented much using it until recently. I've always been put off by the lack of inbuilt support for these common data structures and there doesn't seen to be any implementations available online. It's possible that these exist out there already and I've failed to find them though, which would be great.

So that leads me to implementing these myself. I've already got a working linked list that I wrote yesterday when I wanted to load an arbitrary number of values in from a configuration file. I'm likely to implement the other two data structures mentioned in the title soon as well.

This has me wondering whether people would be interested in me releasing the source code for these so they can make use of them in their own projects? I've added a poll as such.

Peter_R

Sorry if the post appeared garbled before, I accidentally submitted it before I had finished writing it :P.

gecko

Yes! it would be a great aport to the comunity!

Hope to see it :)

I think that Drumpi was working on some kind of list data type, but i don't now if he finally released it.
Torres Baldi Studio
http://torresbaldi.com

Peter_R

Any recommendation on which license the software should be released under? I've been looking at permissive open source licenses and am thinking maybe MIT?

FreeYourMind


Peter_R

Additionally, are there any other data structures that people think would be useful to have?

handsource-dyko

Yes!  :) I would really like to see this as it is very usefull. About two months ago I made a small library for stringslists using processes and a dynamic array to learn myself a vew basics of manual memory managment and pointers. My implementation is a bit crude and I released it under the zlib license, but normally I use the gpl/lgpl for my projects. I choose zlib because of it's permissive nature wich is conveint for libraries.

You can download it here: http://code.google.com/p/dykodialogs-for-bennugd/downloads/detail?name=dyko_stringlist_library.zip&can=2&q=

Just think of the possiblities: linked lists, dynamic arrays and hash tables are usefull for so many different things, like gui's, item managment, file lists, text search, you name it. Also a lot of languages have standard facilities for this, wich also allows for more robust software as it avoids manual memory managment.

I suggest implementing it as a library written in bennu itself, (wich should be possible) so that it's easily portable. A dll is less desireble as it requires knowledge of C compilers and build systems wich is something I dread. Anyway I really like the idea. 8)

Peter_R

My initial aim is to implement these things natively in BennuGD though I know enough I could implement "proper" modules if performance is an issue.

Peter_R

I've created a repo on GitHub here which is where I'll be working on this stuff. As is the nature of open source software, any contributions will be welcome :).

Each data type I implement will have a full set of tests for the API I'm exposing so hopefully any major bugs should get caught in this net. I've fairly extensively tested the linked list I have at the moment in terms of correctness but I'm not sure how the performance is.

I need to expose some sort of iteration interface for it as well to minimise pointlessly walking N! elements when you want to iterate over all N elements, or say the first M of these. The iterator interface will realise this.

handsource-dyko

great!

Will you also put archived versions on there?

Peter_R

By archived do you mean historic versions or zipped up distributions to download and copy into your project's directory?

handsource-dyko


Peter_R

I'll periodically zip up milestone releases I guess. I'll try and find time to get the linked list up there later today.