FAQs on the exercise Linked Lists Adding and Removing Nodes
There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
Agree with a comment or answer? Like () to up-vote the contribution!
Wondering the same! I am thinking like real-life example, you are linking destination with origin but…now i am thinking maybe is problematic and more costly to computing if you wanna find end nodes, you would never find the end of a search giving a infinite bucle? or…well, also would be more costly if you wanna add a new node cuz you should look the one before, link to other and remove the unlinked one instead of simply adding up new one. It is the two things i am thinking now. They are 3 operations instead of 1?
“Since the nodes use links to denote the next node in the sequence, the nodes are not required to be sequentially located in memory.”
Can someone could give more details about that please? How does the memory process works?
What I understood until now, maybe it will helps some people:
Linked lists are more memory efficient than arrays because each value of an array will be stock in an individual memory adress, so if your array has 50 values and you use only 25 of them, you will waste 25 memory locations.
Linked list wil use only the memory that is needed.
I tried to create a function to remove all the nodes having the same value, but I’m having a hard time understanding the logic behind it.
Could you get a look at my code (I created a function called “remove_nodes()”) and tell me how to implement it (or rather, explain me how I can do it), please?