evaluating postfix expression linked lists overview in "arrays,we saw that arrays had certain disadvantages as data storage structures in an unordered arraysearching is slowwhereas in an ordered arrayinsertion is slow in both kinds of arrays deletion is slow alsothe size of an array can' be changed after it' created in this we'll look at data storage structure that solves some of these problemsthe linked list linked lists are probably the second most commonly used general-purpose storage structures after arrays the linked list is versatile mechanism suitable for use in many kinds of general-purpose databases it can also replace an array as the basis for other storage structures such as stacks and queues in factyou can use linked list in many cases where you use an array (unless you need frequent random access to individual items using an indexlinked lists aren' the solution to all data storage problemsbut they are surprisingly versatile and conceptually simpler than some other popular structures such as trees we'll investigate their strengths and weaknesses as we go along in this we'll look at simple linked listsdouble-ended listssorted listsdoubly linked listsand lists with iterators (an approach to random access to list elementswe'll also examine the idea of abstract data types (adtsand see how stacks and queues can be viewed as adts and how they can be implemented as linked lists instead of arrays links in linked listeach data item is embedded in link link is an object of class called something like link because there are many similar links in listit makes sense to use separate class for themdistinct from the linked list itself each link object contains reference (usually called nextto the next link in the list field in the list itself contains reference to the first link this is shown in figure here' part of the definition of class link it contains some data and reference to the next link class link public int idatapublic double ddatapublic link next/data /data /reference to next link this kind of class definition is sometimes called self-referential because it contains field--called next in this case--of the same type as itself we show only two data items in the linkan int and double in typical application there would be many more personnel recordfor examplemight have nameaddresssocial security numbertitlesalaryand many other fields often an object of class that contains this data is used instead of the items