To create a linked list, declaring the number of notes in the code, is necessary? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

To create a linked list, declaring the number of notes in the code, is necessary?

a. Yes b. No

1st Dec 2021, 1:33 PM
Adam M. El-dodo
Adam M. El-dodo - avatar
6 Answers
+ 3
No
1st Dec 2021, 2:43 PM
Suraj Patil
Suraj Patil - avatar
+ 2
Assuming you meant nodes (not notes), it depends, whether the code author wants such information to be cached.
1st Dec 2021, 2:05 PM
Ipang
+ 1
Adam M. El-dodo this is a baby question, and the answer, obviously, is no
1st Dec 2021, 2:58 PM
Rishi
Rishi - avatar
+ 1
No.. Because when u create a linked list .. This will allocate a memory in heap section which provide dynamic nature to grow and shrink the list at any time...when heap is full u may get some error while creating the node u have to check these thing and type conversion need to do.
1st Dec 2021, 6:49 PM
Pranshu Sachan
+ 1
You can think of them as links in a chain. You can (with the right tools) cut one off or add one in. That's actually the real reason to use linked lists instead of arrays.
2nd Dec 2021, 8:30 PM
Joseph Fruin
Joseph Fruin - avatar
+ 1
Because arrays are MUCH faster on most machines.
2nd Dec 2021, 8:31 PM
Joseph Fruin
Joseph Fruin - avatar