Skip to main content Accessibility help
Internet Explorer 11 is being discontinued by Microsoft in August 2021. If you have difficulties viewing the site on Internet Explorer 11 we recommend using a different browser such as Microsoft Edge, Google Chrome, Apple Safari or Mozilla Firefox.

Chapter 19: Linked List

Chapter 19: Linked List

pp. 546-578

Authors

, Techno India Hooghly, West Bengal, , Techno India College of Technology, West Bengal
  • Add bookmark
  • Cite
  • Share

Extract

We know that to store a set of elements we need to declare an array. But when we handle large set of elements there are some disadvantages of array. First of all the allocation of an array is static. Thus we need to mention the size of the array before compilation and this size cannot be changed throughout the program. We have to execute the program for fixed specified set of elements. But this is not possible in real life. Suppose, we want to write a program that will read student's name, roll number and marks of various subjects from user or from file and prepare a result sheet in descending order of total marks. If we write this program using an array, then it will be executed for fixed number of students. But generally in different classes or sections number of students varies. So, a single program is not sufficient. We need to write programs for each class/ section; though the program logic is same for all cases. Different program is required only for different array size. One solution is to declare an array which is sufficiently large. But this may lead to the problem of wastage of memory. Again in certain situation, if more elements need to store than the defined one, then it also faces the lack of memory problems. Sometimes it may happen that requirement may changes with the time. In these cases, old programs are needed to modify. Solution of these problems is Dynamic Allocation. But only Dynamic Allocation is not the solution. Sometimes it is not always possible to predict the size of the array at the very beginning of the program.

About the book

Access options

Review the options below to login to check your access.

Purchase options

Paperback
US$105.00

Have an access code?

To redeem an access code, please log in with your personal login.

If you believe you should have access to this content, please contact your institutional librarian or consult our FAQ page for further information about accessing our content.

Also available to purchase from these educational ebook suppliers