CPS120: Introduction to Computer Science - PowerPoint PPT Presentation

About This Presentation
Title:

CPS120: Introduction to Computer Science

Description:

CPS120: Introduction to Computer Science Abstract Data Types Nell Dale John Lewis Abstract Data Types Abstract data type: a data type whose properties (data and ... – PowerPoint PPT presentation

Number of Views:221
Avg rating:3.0/5.0
Slides: 16
Provided by: wcc73
Learn more at: http://space.wccnet.edu
Category:

less

Transcript and Presenter's Notes

Title: CPS120: Introduction to Computer Science


1
CPS120 Introduction to Computer Science
Abstract Data Types
Nell Dale John Lewis
2
Abstract Data Types
  • Abstract data type a data type whose properties
    (data and operations) are specified independently
    of any particular implementation
  • The goal in design is to reduce complexity
    through abstraction

3
Abstract Data Types
  • Data structures the implementation of a
    composite data fields in an abstract data type
  • Containers in which data items are stored

4
Linked Implementation
  • Linked implementation based on the concept of a
    node
  • A node is made up of two pieces of data the item
    that the user wants in the list and a pointer to
    the next node in the list

5
Linked Implementation
A linked list
6
Linked Implementation
An unsorted linked list
7
Linked Implementation
A sorted linked list
8
Linked Implementation
Store a node with info of 67 after current
9
Linked Implementation
Remove node next(current)
10
Stacks
  • A stack is an abstract data type in which
    accesses are made at only one end
  • LIFO, which stands for Last In First Out
  • The insert is called Push and the delete is
    called Pop

11
Queues
  • Queue is an abstract data type in which items are
    entered at one end and removed from the other end
  • FIFO, for First In First Out
  • Like a waiting line in a bank or supermarket
  • No standard queue terminology
  • Insert is used for the insertion operation
  • Remove is used for the deletion operation.

12
Trees
  • ADTs such as lists, stacks, and queues are linear
    in nature
  • More complex relationships require more complex
    structures

13
Trees
  • Hierarchical structures are called trees
  • Binary trees
  • Each node has no more than two children
  • The beginning of the tree is a unique starting
    node called the root
  • If a node in the tree has no children, it is
    called a leaf node

A binary tree
14
Binary Search Trees
  • A binary search tree has the shape property of a
    binary tree

15
Binary Search Tree
The value in any node is greater than the value
in any node in its left subtree and less than the
value in any node in its right subtree
Write a Comment
User Comments (0)
About PowerShow.com