what is the difference between arrays and linked list
Answer Posted / durairaj
Arrays
Strengths
1.Easy to use
2.No memory management needed
3.Can access any element by index
4.Fairly quick to loop
Weaknesses
1.Static size (can’t increase the size)
2.Most likely not enough or too much memory (you never know
how many elements are needed)
Linked Lists
Strengths
1.Dynamic size (can increase or decrease the list)
2.No memory is wasted
Weaknesses
1.Lots of overhead code (lots of malloc calls and assigning
pointers)
2.Must traverse entire list to go to the nth node.
Now I know that other languages such as C# and Java have
better data structures than arrays and linked lists (like
ArrayLists and Vectors), but this is for the C language and
it doesn’t have those. So based on what you’ve read above
you can decide which is better for the job needed. Neither
arrays nor linked lists are better but they do have their
specific purposes.
| Is This Answer Correct ? | 23 Yes | 4 No |
Post New Answer View All Answers
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
Explain how can you check to see whether a symbol is defined?
Why is C language being considered a middle level language?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
Why we use break in c?
What is scanf () in c?
In c language can we compile a program without main() function?
What does == mean in texting?
What is this pointer in c plus plus?
What is the difference between void main and main in c?
What is structure pointer in c?
What is abstract data structure in c?
List some basic data types in c?
what do the 'c' and 'v' in argc and argv stand for?
What is string in c language?