Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New Container library coming soon!
#1
I needed a good stack for Inspiration so I started to build one with arrays. I knew that the stack would always be all different sizes, and I wanted to cut down on space, so I decided to make it a dynamically allocated Linked List.

Once I got that done I continued to work on this, because I think FreeBasic needs a really good Container Library. There are loads of function already for Doubly Linked Lists and Stack, I may add support for Queues and Binary Search trees. At the time it only holds integers, but it will be a pretty simple conversion to use any type. I also overloaded the hell out of it, so you can pass in either a linked list, and a list element or pointers to both or any combination of the two.


What other Functions should I add?

Linked List:

Append
Prepend
Insert (position)
InsertBefore
InsertAfter
Search
Peek
Remove
New
Purge

Attributes:
Head
Tail
Size


Stack:

New
Purge
Push
Pop
Peek

Attributes:

Head
Tail
Size
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Reply
#2
you might try this. it's old and a bit broken but does the job.
http://www.freebasic.net/forum/viewtopic...=container
url]http://fbide.sourceforge.net/[/url]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)