Chapter 11 Data Structures. Understand arrays and their usefulness. Understand records and the difference between an array and a record. Understand the.

Slides:



Advertisements
Similar presentations
Linked Lists Linked Lists Representation Traversing a Linked List
Advertisements

CHP-5 LinkedList.
M180: Data Structures & Algorithms in Java
Foundation of Computing Systems Lecture 2 Linked Lists.
Data Structures: A Pseudocode Approach with C
Ceng-112 Data Structures I 1 Chapter 3 Linear Lists.
Computer Science: A Structured Programming Approach Using C1 8-4 Array Applications In this section we study two array applications: frequency arrays with.
©Brooks/Cole, 2003 Chapter 11 Data Structures. ©Brooks/Cole, 2003 Understand arrays and their usefulness. Understand records and the difference between.
Lecture - 1 on Data Structures. Prepared by, Jesmin Akhter, Lecturer, IIT,JU Data Type and Data Structure Data type Set of possible values for variables.
Chapter 15 B External Methods – B-Trees. © 2004 Pearson Addison-Wesley. All rights reserved 15 B-2 B-Trees To organize the index file as an external search.
1 Problem Solving Abstraction Oftentimes, different real-world problems can be modeled using the same underlying idea Examples: Runtime storage, Undo operation.
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.
Main Index Contents 11 Main Index Contents Abstract Model of a List Obj. Abstract Model of a List Obj. Insertion into a List Insertion into a List Linked.
Chapter 4 Linked Structures. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 4-2 Chapter Objectives Describe the use of references to create.
Summary of lectures (1 to 11)
Linked Lists list elements are stored, in memory, in an arbitrary order explicit information (called a link) is used to go from one element to the next.
Variations of Linked Lists CS 308 – Data Structures.
… 907 … 011Train… 012Doll 106Car 200… … … Index File Data File (TOY) Blocking factor:
Self Referential Structure. A structure may not contain a member of its own type. struct check { int item; struct check n; // Invalid };
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Chapter 12 Data Structure Associate Prof. Yuh-Shyan Chen Dept. of Computer Science and Information Engineering National Chung-Cheng University.
Computers Data Representation Chapter 3, SA. Data Representation and Processing Data and information processors must be able to: Recognize external data.
Linked Lists list elements are stored, in memory, in an arbitrary order explicit information (called a link) is used to go from one element to the next.
Chapter 8: Data Abstractions Senem Kumova Metin. 8-2 Chapter 8: Data Abstractions 8.1 Basic Data Structures – Arrays – Lists, Stacks, Queues – Trees 8.2.
1 Chapter 16-1 Linked Structures Dale/Weems. 2 Chapter 16 Topics l Meaning of a Linked List l Meaning of a Dynamic Linked List l Traversal, Insertion.
Data Strcutures.
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.
(1 - 1) Introduction to C Data Structures & Abstract Data Types Instructor - Andrew S. O’Fallon CptS 122 (August 26, 2015) Washington State University.
Department of Computer Science Data Structures Using C++ 2E Chapter 5 Linked Lists.
The List ADT A sequence of zero or more elements A 1, A 2, A 3, … A N-1 N: length of the list A 1 : first element A N-1 : last element A i : position i.
1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C arrays ❏ To be able to pass arrays and array elements to functions.
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.
Subject Name : Data Structure Using C Title : Linked Lists
Review 1 Polish Notation Prefix Infix Postfix Precedence of Operators Converting Infix to Postfix Evaluating Postfix.
Data Structures Chapter 6. Data Structure A data structure is a representation of data and the operations allowed on that data. Examples: 1.Array 2.Record.
Chapter 12 Abstract Data Type. Understand the concept of an abstract data type (ADT). Understand the concept of a linear list as well as its operations.
1. Circular Linked List In a circular linked list, the last node contains a pointer to the first node of the list. In a circular linked list,
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Elementary Data Structures Linked Lists Linked Lists Dale.
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 understand the relationship between arrays and pointers ❏ To understand the.
1 M I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
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:
1 Data Structures and Algorithms Outline This topic will describe: –The concrete data structures that can be used to store information –The basic forms.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Linked Lists Outline Introduction Self-Referential Structures.
Linked Lists Chapter Introduction To The Linked List ADT Linked list: set of data structures (nodes) that contain references to other data structures.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 17: Linked Lists.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 18: Linked Lists.
Data Structure and Algorithm: CIT231 Lecture 6: Linked Lists DeSiaMorewww.desiamore.com/ifm1.
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.
UNIT – I Linked Lists.
Review Deleting an Element from a Linked List Deletion involves:
Data Structure and Algorithms
UNIT-3 LINKED LIST.
Chapter 8 Arrays Objectives
External Methods Chapter 15 (continued)
Database Linked List Representation
Chapter 15 Lists Objectives
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.
Chapter 11 Data Structures.
Chapter 17: Linked Lists.
Chapter 11 Data Structures 1.
MTree An implementation and An example with m=3
Chapter 9 Linked Lists.
LINEAR DATA STRUCTURES
Presentation transcript:

Chapter 11 Data Structures

Understand arrays and their usefulness. Understand records and the difference between an array and a record. Understand the concept of a linked list and the difference between an array and a linked list. After reading this chapter, the reader should be able to: O BJECTIVES Understand when to use an array and when to use a linked-list.

Data Structures Data structure uses a collection of related variables that can be accessed individually or as a whole. Data structure a scheme for  organizing related pieces of data.  allowing different operations to be performed on the data. The basic types of data structures include:  files  lists  arrays  records  trees  tables

ARRAYSARRAYS 11.1

Array Array a fixed-size, sequenced collection of elements of the same data type. The subscripts indicate the ordinal number of the element counting from the beginning of the array.

Figure 11-1 Twenty individual variables

Figure 11-2 Processing individual variables

Figure 11-3 Arrays with subscripts and indexes

Figure 11-4 Processing an array

Figure 11-5 Frequency array Show the number of elements with the same value found in a series of numbers.

Figure 11-6 Histogram A pictorial representation of a frequency array.

Figure Part I Two-dimensional array

Figure 11-8 Memory layout Row-major storage

RECORDSRECORDS 11.2

Record Record a collection of related elements, possibly of different types, having a single name. Each element in a record is called a field. Difference  Array: all elements – same type  Record: elements – same or different types.

Figure 11-9 Records

The elements in a record can be of the same or different types. But all elements in the record must be related. Note:

LINKEDLISTSLINKEDLISTS 11.3

Linked list Linked list an ordered collection of data in which each element contains the location of the next element. Each element contains two parts: data and link. The link contains a pointer (an address) that identifies the next element in the list. Singly linked list The link in the last element contains a null pointer, indicating the end of the list.

Figure Linked lists

Figure Node Nodes : the elements in a linked list. The nodes in a linked list are called self-referential records. Each instance of the record contains a pointer to another instance of the same structural type.

Figure Inserting a node

Figure Deleting a node

Figure Traversing a list