Glad to see that some still accord importance to data structure 😀
I advice you to replace naked pointer (aka node*) by smart pointer like std::shared_ptr. The small overhead introduced by smart ptr is largely counterbalanced by the better and easier memory management you will gain.
You save time by not handling crazy memory issues => you have more time to do real optimization to your algorithm => your program runs faster.
Thank you very much for your advice. I am still a student and have much to learn <3
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.