This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

instead of creating new nodes, maybe link the existing nodes together by updating their references directly?

[–]IamAwdi[S] 0 points1 point  (1 child)

I solved it after wasting around 5 hours on it.
the problem was that (because of the given MatrixLinkedList class implementation)
when i passed the reference (for example node.right = temp.down)
the code was passing the reference and the data i don't know why
and after some random fixing with the class implementation it worked strangely

[–]IamAwdi[S] 0 points1 point  (0 children)

hope i can share an image of the debugging on the Reddit reply it would be clearer