Data Structures - PowerPoint PPT Presentation

1 / 44
About This Presentation
Title:

Data Structures

Description:

Focuses on the nouns of a problem's specification. Programmers: ... Create types called classes made up ofdata members and function members to operate on the data. ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 45
Provided by: CSS65
Category:
Tags: data | nouns | of | structures | types

less

Transcript and Presenter's Notes

Title: Data Structures


1
Data Structures
  • Goal organize data
  • Criteria facilitate efficient
  • storage of data
  • retrieval of data
  • manipulation of data
  • Process
  • select and design appropriate data types

2
Examples
3
Tradeoff
4
abstract data type (ADT)
5
implementation of an ADT
6
(No Transcript)
7
Simple Data Types (2.2)
8
Boolean data
9
Character Data
10
Integer Data
11
Sign-magnitude representation
12
Two's complement representation
13
(No Transcript)
14
Biased representation
15
Problems with Integer Representation
  • Limited Capacity -- a finite number of bits
  • Overflow
  • - addition or multiplication can exceed largest
    value permitted by storage scheme
  • Underflow
  • - subtraction or multiplication can exceed
    smallest value permitted by storage scheme
  • Not a perfect representation of (mathematical)
    integers
  • can only store a finite (sub)range of them

16
Real Data
17
Problems with Real Representation
18
C-Style One-Dimensional Arrays (2.3)
19
Declaring arrays in C
20
Subscript operator
21
(No Transcript)
22
Array Initialization
23
(No Transcript)
24
(No Transcript)
25
Initializations with no array size specified
26
Addresses
27
(No Transcript)
28
C-Style Multidimensional Arrays
29
(No Transcript)
30
(No Transcript)
31
(No Transcript)
32
(No Transcript)
33
(No Transcript)
34
(No Transcript)
35
Problems with C-Style Arrays
  • Capacity cannot change.
  • No predefined operations on non-char arrays.
  • Must perform bounds checking, size
    restrictions, ...
  • C-style arrays aren't self-contained.
  • Must pass size (and/or capacity) to
    array-processing functions.
  • Solution (OOP)
  • Encapsulate array, capacity, size, and operations
    in a class. vector

36
(No Transcript)
37
(No Transcript)
38
(No Transcript)
39
(No Transcript)
40
(No Transcript)
41
(No Transcript)
42
A commercial for OOP Two programming paradigms
  • Object-oriented ( C, Java, and Smalltalk)
  • Focuses on the nouns of a problem's specification
  • Programmers
  • Determine what objects are needed for a problem
    and how they should work together to solve the
    problem.
  • Create types called classes made up ofdata
    members and function members to operate on the
    data. Instances of a type (class) are called
    objects.
  • Procedural ( C, FORTRAN, and Pascal )
  • Action-oriented concentrates on the verbs of a
    problem's specification
  • Programmers
  • Identify basic tasks to be performed to solve
    problem
  • Implement the actions required to do these tasks
    as subprograms (procedures/functions/subroutines)
  • Group these subprograms into programs/modules/libr
    aries, which together make up a complete system
    for solving the problem

43
(No Transcript)
44
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com