Wednesday, 17 January 2018
Friday, 12 January 2018
Why do I need a linked list and why is it important?
You have already seen how data is organized and processed sequentially using array , called a sequential list.we have performed several operations on sequential list, such as sorting, inserting, deleting and searching.If data is not sorted, searching for an item in the list can be very time consuming, especially with large lists.Once the data is stored, you can use binary search algorithm and improve the search algorithm.However in this case insertion and deletion become time consuming especially with large lists.Because this operation require data movement.Also , because array size must be fixed during execution , new items can be added only if there is place.Thus,there are limitations when you organize data in an array.
Linked list helps you to overcome these problems.when data is stored in an array,memory for the components of the array is contiguous i.e the blocks are allocated one after the others.However the component of a linked list need not be contiguous.Linked list uses pointers to organize and process data in lists.
Subscribe to:
Comments (Atom)
-
You have already seen how data is organized and processed sequentially using array , called a sequential list . we have performed severa...