Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

differentiate built-in functions and user – defined functions.

1084


In a header file whether functions are declared or defined?

1126


What is the purpose of the preprocessor directive error?

1266


Write program to remove duplicate in an array?

1078


Do you know null pointer?

1021


What is operator precedence?

1204


How can you increase the allowable number of simultaneously open files?

1153


code for find determinent of amatrix

1960


Explain what is the difference between a string and an array?

1166


What is the benefit of using #define to declare a constant?

1090


Explain c preprocessor?

1110


What is #include stdio h?

1115


What is linear search?

1132


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

1203


develop algorithms to add polynomials (i) in one variable

2163