Working LinkedList using pointers
https://github.com/MVPavan/mojos/blob/master/learn/dsa/my_linked_list.mojo
I have created linked list in Mojo, it runs fine with all the methods and deletions. However debug is failing, any idea why ?
Also any feedback on deletion, memory leaks is also appreciated.
GitHub
mojos/learn/dsa/my_linked_list.mojo at master · MVPavan/mojos
Collection of mojo codes. Contribute to MVPavan/mojos development by creating an account on GitHub.
1 Reply
Hello @PavanMV , the current
__moveinit__
implementation does not free existing.data
yet
(remember, you move what is in some place, to another place, have to free the previous space)
It could be a good idea to sort of do it again (re put-together the parts),
and each time before adding the next feature/part, make sure that the tests passes 👍
That way you'll catch and fix the 'bugs' as they come and it is easier to think.