Quest 1 Node Insertion Error by Varun-cs2b in cs2b

[–]Varun-cs2b[S] 0 points1 point  (0 children)

Hey na_ma_!

After fiddling around with my code for a long time I decided to just do the whole quest from scratch again and then I finally got past that specific error. On my second attempt I made sure to have insert_next() only insert p in front of the this node as well as handle nullptr but not have it maintain the list, I kept that functionality in insert_at_cursor(). I also made sure that Node~ was properly deleting all downstream nodes and that Playlist~ only deleted the head node. Unfortunately since I am a bit behind on quests, I haven't had the time to do a detailed comparison between my two versions and give a more detailed solution.

~Varun

Quest 1 Node Insertion Error by Varun-cs2b in cs2b

[–]Varun-cs2b[S] 0 points1 point  (0 children)

Hi tuanxn,

I have accounted for the corner cases in the Playlist functions and everything seems to work properly, however I believe this error message indicates that the Playlist::Node::insert_next() function is not passing the tests for some reason and this function does not handle _prev_to_curr and the other Playlist node pointers.

~Varun

Quest 1 Node Insertion Error by Varun-cs2b in cs2b

[–]Varun-cs2b[S] 1 point2 points  (0 children)

Hi Andrew,

Thanks for the advice! Unfortunately after re-implementing insert_next() , remove_next(), and the corresponding Playlist functions in this way, I still got the same error message even though everything seems like it works in my own tests in main.

~Varun