Presentation is loading. Please wait.

Presentation is loading. Please wait.

Foundation of Computing Systems Lecture 2 Linked Lists.

Similar presentations


Presentation on theme: "Foundation of Computing Systems Lecture 2 Linked Lists."— Presentation transcript:

1 Foundation of Computing Systems Lecture 2 Linked Lists

2 29.07.09IT 60101: Lecture #22 Array vs. Linked List Array –elements are stored in a contagious memory locations –static data structure Linked list –adjacency between any two elements are maintained by means of links or pointers –dynamic data structures

3 29.07.09IT 60101: Lecture #23 Linked List A linked list is an ordered collection of finite, homogeneous data elements called nodes where the linear order is maintained by means of links or pointers Single linked list, circular linked list, and double linked list

4 29.07.09IT 60101: Lecture #24 Linked List Representation: Static

5 29.07.09IT 60101: Lecture #25 Linked List Representation: Dynamic

6 29.07.09IT 60101: Lecture #26 Linked List Representation: Dynamic

7 29.07.09IT 60101: Lecture #27 Operations on Single Linked List Traversing a list –Searching for an element in a list Insertion of a node into a list Deletion of a node from a list Copy a linked list to make a duplicate Merging two linked lists into a larger list

8 29.07.09IT 60101: Lecture #28 Single Linked List: Insertion Insertion steps –Get a new node from memory bank –Start from the header node –Manage links to Insert at front Insert at end Insert at any position

9 29.07.09IT 60101: Lecture #29 Single Linked List: Insert at Front

10 29.07.09IT 60101: Lecture #210 Single Linked List: Insert at End

11 29.07.09IT 60101: Lecture #211 Single Linked List: Insert at Any Place

12 29.07.09IT 60101: Lecture #212 Single Linked List: Deletion Deletion steps –Start from the header node –Manage links to Delete at front Delete at end Delete at any position –Return the deleted node to memory bank

13 29.07.09IT 60101: Lecture #213 Single Linked List: Delete at Front

14 29.07.09IT 60101: Lecture #214 Single Linked List: Delete at End

15 29.07.09IT 60101: Lecture #215 Single Linked List: Delete at Any Place

16 29.07.09IT 60101: Lecture #216 Single Linked List: Copy

17 29.07.09IT 60101: Lecture #217 Circular Linked List

18 29.07.09IT 60101: Lecture #218 Merging Two Circular Linked Lists

19 29.07.09IT 60101: Lecture #219 Double Linked List

20 29.07.09IT 60101: Lecture #220 Double Linked List: Insertion

21 29.07.09IT 60101: Lecture #221 Double Linked List: Deletion

22 29.07.09IT 60101: Lecture #222 Applications of Linked Lists Sparse matrix manipulation Polynomial manipulation Memory management

23 29.07.09IT 60101: Lecture #223 Application of Linked List: Sparse Matrix

24 29.07.09IT 60101: Lecture #224 Application of Linked List: Sparse Matrix

25 29.07.09IT 60101: Lecture #225 Application of Linked List: Sparse Matrix

26 29.07.09IT 60101: Lecture #226 Application of Linked List: Polynomial P(x) = a n x en + a n–1 x en–1 + · · · + a 1 x e1 P(x) = 3x 8 – 7x 6 + 14x 3 + 10x – 5

27 29.07.09IT 60101: Lecture #227 Application of Linked List: Polynomial For polynomial manipulation See the book Classic Data Structures Chapter 3 PHI, 2 nd Edn., 17 th Reprint

28 29.07.09IT 60101: Lecture #228 Application of Linked List: Memory For memory management See the book Classic Data Structures Chapter 3 PHI, 2 nd Edn., 17 th Reprint


Download ppt "Foundation of Computing Systems Lecture 2 Linked Lists."

Similar presentations


Ads by Google