Skip to main content Accessibility help
×
Hostname: page-component-6bb9c88b65-vmslq Total loading time: 0 Render date: 2025-07-27T08:37:52.893Z Has data issue: false hasContentIssue false

19 - Linked List

Published online by Cambridge University Press:  17 July 2025

Subrata Saha
Affiliation:
Techno India Hooghly, West Bengal
Subhodip Mukherjee
Affiliation:
Techno India College of Technology, West Bengal
Get access

Summary

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.

Information

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2016

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Book purchase

Temporarily unavailable

Accessibility standard: Unknown

Accessibility compliance for the PDF of this book is currently unknown and may be updated in the future.

Save book to Kindle

To save this book to your Kindle, first ensure no-reply@cambridge-org.demo.remotlog.com is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×