Incomputer science, alinked listis adata structureconsisting of a - TopicsExpress



          

Incomputer science, alinked listis adata structureconsisting of a group ofnodeswhich together represent a sequence. Under the simplest form, each node is composed of a data and areference(in other words, alink) to the next node in the sequence; more complex variants add additional links. This structure allows for efficient insertion or removal of elements from any positionin the sequence.A linked list whose nodes contain two fields: an integer value and a link to the next node. The last node is linked to a terminator used to signify the end of the list.Linked lists are among the simplest and most common data structures. They can be used to implement several other commonabstract data types, includinglists(the abstract data type),stacks,queues,associative arrays, andS-expressions, though it is not uncommon to implement the other data structures directly without using a list as the basis of implementation.The principal benefit of a linked list over a conventionalarrayis that the list elements can easily be inserted or removed without reallocation or reorganization of the entire structure because the data items need not be stored contiguously in memory or on disk, while an array has to be declared in the source code, before compiling and running the program. Linked lists allow insertion and removal of nodes at any point in the list, and can do so with a constant number of operations if the link previous to the link being added or removed is maintained during list traversal.On the other hand, simple linked lists by themselves do not allowrandom accessto the data, or any form of efficient indexing. Thus, many basic operations — such as obtaining the last node of the list (assuming that the last node is notmaintained as separate node reference in the list structure), or finding a node that contains a given datum, or locating the place where a new node should be inserted — may require sequential scanning of most or all of the list elements. The advantages and disadvantages of using linked lists are as follows:-Advantages:*.Linked lists are a dynamic data structure, allocating the needed memory while the programis running.*.Insertion and deletion node operations are easilyimplemented in a linked list.*.Linear data structures such as stacks and queues are easily executed with a linked list.*.They can reduce access time and may expand inreal time without memory overhead.Disadvantages:*.They have a tendency to waste memory due topointersrequiring extra storage space.*.Nodes in a linked list must be read in order from the beginning as linked lists are inherentlysequential access.*.Nodes are stored incontiguously, greatly increasing the time required to access individualelements within the list.*.Difficulties arise in linked lists when it comes to reverse traversing. Singly linked lists are extremely difficult to navigate backwards, and while doubly linked lists are somewhat easier to read, memory is wasted in allocating space for a back pointer.HistoryLinked lists were developed in 1955–1956 byAllen Newell,Cliff ShawandHerbert A. SimonatRAND Corporationas the primarydata structurefor theirInformation Processing Language. IPL was used by the authors to develop several earlyartificial intelligenceprograms, including the LogicTheory Machine, theGeneral Problem Solver, and a computer chess program. Reports on their work appeared in IRE Transactions on Information Theory in 1956, and several conference proceedings from 1957 to 1959, including Proceedings of the Western Joint Computer Conference in 1957 and 1958, and Information Processing (Proceedings of the firstUNESCOInternational Conference on Information Processing) in 1959. The now-classic diagram consisting of blocks representing list nodes with arrows pointing to successive list nodes appears in Programming the Logic Theory Machine by Newell and Shaw in Proc. WJCC, February 1957. Newell and Simon were recognized with the ACMTuring Awardin 1975 for having made basic contributions to artificial intelligence, the psychology of human cognition, and list processing. The problem ofmachine translationfornatural languageprocessing ledVictor YngveatMassachusetts Institute of Technology(MIT) touse linked lists as data structures in his COMIT programming language for computer research in the field oflinguistics. A report on this language entitled A programming language for mechanical translation appeared in Mechanical Translation in1958.LISP, standing for list processor, was created byJohn McCarthyin 1958 while he was at MIT and in1960 he published its design in a paper in theCommunications of the ACM, entitled Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I. One of LISPs major data structures is the linked list.By the early 1960s, the utility of both linked lists and languages which use these structures as their primary data representation was well established. Bert Green of theMIT Lincoln Laboratorypublished a review article entitledComputer languages for symbol manipulation in IRE Transactions on Human Factors in Electronicsin March 1961 which summarized the advantages of the linked list approach. A later review article, AComparison of list-processing computer languages by Bobrow and Raphael, appeared in Communications of the ACM in April 1964.Several operating systems developed byTechnical Systems Consultants(originally of WestLafayette Indiana, and later of Chapel Hill, North Carolina) used singly linked lists as file structures.A directory entry pointed to the first sector of a file,and succeeding portions of the file were located by traversing pointers. Systems using this technique included Flex (for theMotorola 6800CPU), mini-Flex (same CPU), and Flex9 (for the Motorola 6809 CPU). A variant developed by TSC for and marketed by Smoke Signal Broadcasting inCalifornia, used doubly linked lists in the same manner.The TSS/360 operating system, developed by IBMfor the System 360/370 machines, used a double linked list for their file system catalog. The directory structure was similar to Unix, where a directory could contain files and/or other directories and extend to any depth. A utility flea was created to fix file system problems after a crash, since modified portions of the file catalog were sometimes in memory when a crash occurred. Problems were detected by comparing the forward and backward links for consistency. If a forward link was corrupt, then if a backward link to the infected node was found, the forward link was set to the node with the backward link. A humorous comment in the source code where thisutility was invoked stated Everyone knows a flea collar gets rid of bugs in cats.Basic concepts and nomenclatureEach record of a linked list is often called anelementornode.The field of each node that contains the address of the next node is usually called thenextlinkornextpointer. The remaining fields are known as thedata,information,value,cargo, orpayloadfields.Theheadof a list is its first node. Thetailof a list may refer either to the rest of the list after the head, or to the last node in the list. InLispand some derived languages, the next node may be called thecdr(pronouncedcould-er) of the list, while the payload of the head node may be called thecar.Singly linked listSingly linked lists contain nodes which have a data field as well as anextfield, which points to the next node in line of nodes. Operations that canbe performed on singly linked lists include insertion, deletion and traversal.A singly linked list whose nodes contain two fields: an integer value and a link to the next nodeDoubly linked listMain article:Doubly linked listIn adoubly linked list, each node contains, besides the next-node link, a second link field pointing to thepreviousnode in the sequence. The two links may be calledforward(s) andbackwards, ornextandprev(previous).A doubly linked list whose nodes contain three fields: an integer value, the link forward to the nextnode, and the link backward to the previous nodeA technique known asXOR-linkingallows a doubly linked list to be implemented using a single link field in each node. However, this technique requires the
Posted on: Fri, 12 Dec 2014 06:35:24 +0000

Trending Topics



="margin-left:0px; min-height:30px;"> Hi all, The Natural Hair Network are looking to organise a similar

Recently Viewed Topics




© 2015