02-24-2006, 07:35 AM
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
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.