Whats the difference between using a linked list in a normal way and using it by creating a separate Node class and stuff. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Whats the difference between using a linked list in a normal way and using it by creating a separate Node class and stuff.

I don't understand some tutorials online teach linked list by creating a node class..and some of them just create a linked list and use function..please enlighten me on this

30th May 2018, 5:43 AM
Suhail Ahmad
Suhail Ahmad - avatar
1 Answer
+ 1
A LinkedList is a data structure, it's a particular way of storing and handling data which has advantages and disadvantages for various areas (e.g. search speed, ease of sorting). I think you mean using a function or an 'in-built' linked list? (e.g. in Java you can simply declare a linked list) You'd probably want to do this in practice, but some tutorials show you how to build the structure yourself. Obviously someone had to build it in the first place and some (like me) like to know how stuff is made rather than know it exists. In practice, especially for languages like python, Java etc you would probably use the inbuilt as it's going to be tested and consistent and may have some optimizations which would be time consuming to make yourself
30th May 2018, 6:34 AM
Dan Walker
Dan Walker - avatar