Foundation of Computing Systems Lecture 2 Linked Lists.

Slides:



Advertisements
Similar presentations
Linear Lists – Linked List Representation
Advertisements

Linked Lists Linked Lists Representation Traversing a Linked List
CHP-5 LinkedList.
Chapter 17 Linked List Saurav Karmakar Spring 2007.
Data Structures: A Pseudocode Approach with C
COSC 1P03 Data Structures and Abstraction 5.1 Linear Linked Structures.
©Brooks/Cole, 2003 Chapter 11 Data Structures. ©Brooks/Cole, 2003 Understand arrays and their usefulness. Understand records and the difference between.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 17: Linked Lists.
©Brooks/Cole, 2003 Chapter 11 Data Structures. ©Brooks/Cole, 2003 Data Structure Data structure uses collection of related variables that can be accessed.
Chapter 12 C Data Structures Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 17: Linked Lists.
Summary of lectures (1 to 11)
Variations of Linked Lists CS 308 – Data Structures.
The Design and Analysis of Algorithms
1 Stack Data : a collection of homogeneous elements arranged in a sequence. Only the first element may be accessed Main Operations: Push : insert an element.
Important Problem Types and Fundamental Data Structures
Doubly Linked Lists Deleting from the end of the list – Have to traverse the entire list to stop right in front of tail to delete it, so O(n) – With head.
Chapter 12 Data Structure Associate Prof. Yuh-Shyan Chen Dept. of Computer Science and Information Engineering National Chung-Cheng University.
Foundation of Computing Systems Lecture 6 Trees: Part III.
Design and Analysis of Algorithms CSC201 Shahid Hussain 1.
Chapter 8 Data Abstractions Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Comp 245 Data Structures Linked Lists. An Array Based List Usually is statically allocated; may not use memory efficiently Direct access to data; faster.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Arrays.
 DATA STRUCTURE DATA STRUCTURE  DATA STRUCTURE OPERATIONS DATA STRUCTURE OPERATIONS  BIG-O NOTATION BIG-O NOTATION  TYPES OF DATA STRUCTURE TYPES.
Lecture 14 Linked Lists 14-1 Richard Gesick. Linked Lists Dynamic data structures can grow and shrink at execution time. A linked list is a linear collection.
Department of Computer Science Data Structures Using C++ 2E Chapter 5 Linked Lists.
Foundation of Computing Systems Lecture 3 Stacks and Queues.
1 CPS216: Data-intensive Computing Systems Operators for Data Access (contd.) Shivnath Babu.
Week 4 - Monday.  What did we talk about last time?  Queues  Implementing queues with circular arrays.
3 Data. Software And Data Data Data element – a single, meaningful unit of data. Name Social Security Number Data structure – a set of related data elements.
Data Structures Using C++1 Chapter 5 Linked Lists.
Linked Lists Data Structures & Problem Solving Using JAVA Second Edition Mark Allen Weiss Chapter 17 © 2002 Addison Wesley.
IT 60101: Lecture #121 Foundation of Computing Systems Lecture 12 Trees: Part VII.
Binary Tree.
Foundation of Computing Systems Lecture 4 Trees: Part I.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Elementary Data Structures Linked Lists Linked Lists Dale.
Linked List X Header X 4000 ptr Question: Search a value 40 in the linked list. Steps: ptr = Header->Link While(ptr.
Department of Computer Science 1 Some Practice Let’s practice for the final a little bit. OK?
 Array is a data structure were elements are stored in consecutive memory location.in the array once the memory is allocated.it cannot be extend any more.
Circular linked list A circular linked list is a linear linked list accept that last element points to the first element.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To introduce the basic concepts of linked lists ❏ To introduce the basic concepts.
Linked list: a list of items (nodes), in which the order of the nodes is determined by the address, called the link, stored in each node C++ Programming:
Lecture 16 Linked Lists. In this lecture Fundamentals Applications Memory Allocation Creating a List Inserting Nodes.
Array 10 GB Hard Disk 2 GB 4 GB2 GB 3 GB DATA 4 GB Free Store data in the form of Array (Continuous memory locations) Solution-1: No Solution. Memory Insufficient.
ARRAYS IN C/C++ (1-Dimensional & 2-Dimensional) Introduction 1-D 2-D Applications Operations Limitations Conclusion Bibliography.
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: TEL 3049.
3/19/2016 5:40 PMLinked list1 Array-based List v.s. Linked List Yumei Huo Department of Computer Science College of Staten Island, CUNY Spring 2009.
Arrays, Link Lists, and Recursion Chapter 3. Sorting Arrays: Insertion Sort Insertion Sort: Insertion sort is an elementary sorting algorithm that sorts.
UNIT-II Topics to be covered Singly linked list Circular linked list
Data Structure and Algorithm: CIT231 Lecture 6: Linked Lists DeSiaMorewww.desiamore.com/ifm1.
LINKED LISTS.
© Oxford University Press All rights reserved. Data Structures Using C, 2e Reema Thareja.
Copyright © 2012 Pearson Education, Inc. Chapter 17: Linked Lists.
Data Structures: A Pseudocode Approach with C 1 Chapter 5 Objectives Upon completion you will be able to: Explain the design, use, and operation of a linear.
IT Department – Bunda Mulia University
Lecture 6 of Computer Science II
Data Structure By Amee Trivedi.
The Design and Analysis of Algorithms
Lectures linked lists Chapter 6 of textbook
Program based on queue & their operations for an application
Review Deleting an Element from a Linked List Deletion involves:
Prepared by, Jesmin Akhter, Lecturer, IIT, JU
11-3 LINKED LISTS A linked list is a collection of data in which each element contains the location of the next element—that is, each element contains.
Linked Lists Chapter 4.
Chapter 17: Linked Lists.
Chapter 11 Data Structures 1.
Important Problem Types and Fundamental Data Structures
LINKED LIST Dr. T. Kokilavani Assistant Professor
Presentation transcript:

Foundation of Computing Systems Lecture 2 Linked Lists

IT 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

IT 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

IT 60101: Lecture #24 Linked List Representation: Static

IT 60101: Lecture #25 Linked List Representation: Dynamic

IT 60101: Lecture #26 Linked List Representation: Dynamic

IT 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

IT 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

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

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

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

IT 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

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

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

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

IT 60101: Lecture #216 Single Linked List: Copy

IT 60101: Lecture #217 Circular Linked List

IT 60101: Lecture #218 Merging Two Circular Linked Lists

IT 60101: Lecture #219 Double Linked List

IT 60101: Lecture #220 Double Linked List: Insertion

IT 60101: Lecture #221 Double Linked List: Deletion

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

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

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

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

IT 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 x x – 5

IT 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

IT 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