doubly linked lists in spin
I haven't seen this anywhere so I thought I'd give it a shot. I use doubly linked lists in C all the time. I
used ctospin to do the initial hard part. Let me know what you think. I'll submit it to obex if it's worth it.
used ctospin to do the initial hard part. Let me know what you think. I'll submit it to obex if it's worth it.
Comments
I'm a fan of abstract data structures like this especially when it helps provide a
clean solution to something otherwise difficult like the travelling salesman problem.
One thing that stops me from trying it out is lack of the serial driver.
I just don't keep MultiCogSerialDebug.spin in my library ...
If you package the project using the File->archive feature, it will be easier to test.
Method names enqueue and dequeue are very common and have clear meanings.
I would certainly object to push/pop [noparse]:)[/noparse] Just my opinion though [noparse]:)[/noparse]
Cheers,
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM
I recommend adding "waitcnt" after debug.start though to give the user terminal time to open up.
Cheers,
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM