|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-6006AAB0-B319-546F-8D79-E2D4887A1E72" xml:lang="en"><title>Singly |
|
13 linked lists</title><shortdesc>A singly linked list is one where each element points forwards |
|
14 to the next element.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <p>Unlike a doubly linked list, elements do <i>not</i> point back to the previous |
|
16 element. The list has an anchor point which points forwards to the first element |
|
17 and also has a pointer to the last element.</p> |
|
18 <p>Anchor points are always referred to as <i>headers</i>.</p> |
|
19 <p>A singly linked list is useful for maintaining a non-circular queue of |
|
20 items; for example, a stack.</p> |
|
21 <fig id="GUID-8FC485D1-5B95-5B71-94F1-00C78A61F7F0"> |
|
22 <title>Singly linked list</title> |
|
23 <image href="GUID-25CBA151-ED8E-5A88-A9FD-F20810371B4D_d0e218049_href.png" placement="inline"/> |
|
24 </fig> |
|
25 <p>Singly linked lists involve the creation and use of the classes:</p> |
|
26 <ul> |
|
27 <li id="GUID-8D31B03F-8978-5292-BE6E-4D3C0EE62460"><p><codeph>TSglQueLink</codeph> </p> </li> |
|
28 <li id="GUID-547C604A-1F01-5FF7-A316-8F09EE9462EC"><p><codeph>TSglQue<class |
|
29 T></codeph> </p> </li> |
|
30 <li id="GUID-E567AD7E-DB54-54B9-8C1E-5C9A36B1C927"><p><codeph>TSglQueIter<class |
|
31 T</codeph> </p> </li> |
|
32 </ul> |
|
33 <p>In practice, these classes are almost always used as components of other |
|
34 classes.</p> |
|
35 </conbody></concept> |