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

Where define directive used?

1031


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

1351


What is the most efficient way to store flag values?

1122


What is an auto variable in c?

1164


Describe dynamic data structure in c programming language?

1034


Here is a good puzzle: how do you write a program which produces its own source code as output?

1030


What is difference between scanf and gets?

1163


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

1012


Why is c so important?

989


What is the difference between fread buffer() and fwrite buffer()?

1104


C program to find all possible outcomes of a dice?

2274


Do you know what are bitwise shift operators in c programming?

1054


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

1223


What is const and volatile in c?

987


What is use of integral promotions in c?

1068