CS221N, Data Structures - PowerPoint PPT Presentation

1 / 40
About This Presentation
Title:

CS221N, Data Structures

Description:

... honor, as an Eckerd College student, I pledge not to lie, cheat, or steal, nor ... Video. Audio. Hardware. Controls the flow of electricity through circuits ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 41
Provided by: cickovt
Category:

less

Transcript and Presenter's Notes

Title: CS221N, Data Structures


1
Introduction
  • CS221N, Data Structures

2
Welcome to Survey!
  • Introductions and Contact Info
  • Syllabus
  • Goals of the course
  • Outline
  • Contingency plans
  • Chapter 1

3
My Information
  • Dr. Trevor M. Cickovski (Dr. C)
  • Office Hours
  • T 9-3
  • H 9-1
  • Office 115C Sheen
  • Phone (727) 864-8272
  • E-mail cickovtm_at_eckerd.edu

4
Objectives
  • This course is designed to give you a basic
    understanding of
  • How a computer works
  • What a computer can do

5
Prerequesite
  • None
  • Assume no background in computers

6
Textbook
  • Nell Dale and John Lewis. Computer Science
    Illuminated Third Edition. Jones and Bartlett
    Publishers, 2007.
  • We will cover (roughly) one chapter per week
  • I encourage you to bring this to class
  • Lectures will follow very closely
  • We will often view examples from this text
  • Recommend but do not enforce reading

7
Labs and the Lab Manual
  • R. Mark Meyer. Explorations in Computer Science
    Second Edition. Jones and Bartlett Publishers,
    2006.
  • Friday will be the lab day
  • Labs together will account for 50 of your
    grade!!
  • Note You must show up
  • The lab must be completed in the allotted 50
    minutes
  • Ill be present to help

8
Lecture
  • Time MWF 1145-1235
  • Room SE 102
  • Slides
  • Prefer interactivity in the lecture
  • Highly recommend but do not enforce attendance
  • Some slides will be purposely incomplete, which
    Ill fill in lecture either on tablets or the
    blackboard if they are not available.

9
Exams
  • Two Third-Term Exams (each 15)
  • Friday 10/2, in class (week 5)
  • Friday 10/30, in class (week 9)
  • Final Exam (20)
  • 1130 AM 230 PM on Wednesday 12/9
  • SE102 unless you hear otherwise

10
Topics
  • Lets go through them together.

11
Each Data Structure
  • Note that there are a total of nine data
    structures well cover
  • Arrays, stacks, queues, linked lists, binary
    trees, red-black trees, hash tables, heaps, and
    graphs
  • Each of these represents a way of storing a
    collection of data
  • For each of them
  • Motivation
  • Operations
  • Efficiency
  • Java Implementation

12
Grade Breakdown
  • A 92-100
  • A- 90-91
  • B 88-89
  • B 82-88
  • B- 80-81
  • C 78-79
  • C 72-78
  • C- 70-71
  • D 60-69
  • F 0-59

13
Hurricane Preparation
  • The plan for this course is to continue
    operations best we can
  • I will continue to post slides online
  • We will continue to follow the syllabus (so bring
    it!)
  • I will continue to follow the textbook (so bring
    it!)
  • Homeworks will continue to be assigned and
    submissible over e-mail.
  • Contact will be made as necessary

14
Disability Accomodations
  • Contact disability support services if necessary
  • dss_at_eckerd.edu
  • 8248 Edmunson Hall
  • This applies to all kinds of disabilities
  • Physical
  • Cognitive
  • Psychological
  • Confidentiality enforced

15
Missing labs and exams
  • Eckerd has changed its policy regarding missing
    labs and exams
  • Lets go through it together
  • Much more trust on your shoulders
  • Remember.
  • Eckerd is small. There are RAs, other
    professors, coaches, people in your dorm, etc.
  • If youre caught faking illness, you fail the
    entire course
  • Your risk if you choose to do so

16
The Honor Code
  • Which youve seen before
  • On my honor, as an Eckerd College student, I
    pledge not to lie, cheat, or steal, nor to
    tolerate these behaviors in others.
  • Academic dishonesty can count as
    cheating/plagiarism
  • Report will be submitted to registrar
  • First offense Could fail the course
  • Second offense Could be dismissed from the
    college

17
The Honor Code
  • When it comes to sharing solutions
  • It is illegal to give
  • It is illegal to receive and use
  • Safest thing is to not give your solution to
    anybody
  • You can trade ideas, but not answers
  • Legal
  • Heres an idea try this.
  • Illegal
  • Heres my writeup. Get ideas from it.

18
The Computer
  • We all use them!
  • Most of us, probably daily
  • Composed of three portions
  • 1. Software, which runs on
  • 2. Hardware, which manipulates and stores
  • 3. Data

19
Data
  • All data stored in a computer can be broken down
    to 0 and 1
  • Called binary format
  • Which actually correspond to ON and OFF.
  • If current is passing through a wire it is ON.

20
Data
  • We will see in this course, we can store ANY type
    of information in binary
  • Numbers
  • Characters (A-Z, a-z, etc.)
  • Images
  • Video
  • Audio

21
Hardware
  • Controls the flow of electricity through circuits
  • In a nutshell, control which wires are on and
    which are off.
  • Hardware can only recognize information in binary
    (on/off).

22
Software
  • Consists of the set of programs which can
  • Perform computations
  • Manage data
  • Programs that the user
  • can run are often called
  • applications.

23
Hardware vs. Software
  • Which do think are which?
  • Processor
  • Memory
  • Microsoft Word
  • Keyboard
  • Minesweeper
  • PowerPoint
  • Mouse

24
Writing Software
  • Software must be programmed somehow.
  • We know hardware can only recognize binary
    information
  • But nobody writes programs in binary!
  • Itd take forever and a day.

25
Writing Software
  • Software is written in a programming language.
  • There are many C, Java, C, Python, Perl
  • A software developer uses a programming language
  • More understandable than binary
  • Any theories why there are so many languages?

REM GET TWO NUMBERS REM FROM THE USER,
AND REM PRINT THE MAX INPUT X INPUT Y IF X
gt Y PRINT X ELSE PRINT Y
26
Translating Software To Binary
  • This is the job of a compiler.
  • Sometimes this translation is done everytime you
    run a program, sometimes its only done once

27
Translating Software To Binary
  • Note Every programming language needs a compiler
    of some form
  • Hardware cannot run programming languages, just
    binary

28
Operating System
  • The operating system is the one program which
    always runs when the computer is on
  • Examples
  • Windows XP
  • Mac OS X
  • Linux
  • UNIX
  • BSD

29
Operating System
  • The job of the operating system is to manage
    the other programs that are running
  • Schedule the programs
  • Multitasking
  • Synchronize data access
  • Manage memory
  • Manage files
  • Protection and security
  • Networking

30
To give you a little taste
  • What goes on in software between when an M is
    pressed and when the character is displayed in
    Microsoft Word
  • The key press interrupts the operating system
  • Operating system transfers control to the active
    program, in this case Microsoft Word
  • Microsoft Word receives M as input, and adds
    this character to the file that is open
  • Microsoft Word transfers control back to the
    operating system
  • When you throw hardware in, its even more

31
Going back to hardware
  • Lets take a deeper look at some of the hardware
    components and their functions
  • Processor Executes instructions
  • Memory Stores data
  • There are many types of memory! Can we name
    some?
  • Keyboard Take input from the user
  • Mouse Take input from the user
  • Printer Take output from a program, and print it
    on paper
  • Deadhorse beat Hardware only understands binary!

32
The Processor
  • The job of a processor is the following
  • Accept an instruction in binary
  • Decode it
  • Execute it
  • Perform arithmetic, access memory, etc.
  • Each instruction takes a certain number of cycles
    to execute
  • Modern processors, avg is roughly 1 cycle per
    instruction

33
The Processor
  • When we say a computer has a 2.3 GHz processor,
    what does this mean?
  • Hz cycles/second
  • Giga 109
  • So this processor executes 2.3109 cycles/s.
  • Which if each instruction takes a cycle, 2.3109
    inst/s.
  • Or 2 billion, 300 million.

34
Memory
  • Have we come up with some different types?
  • There are actually five
  • 1. Registers
  • 2. Cache
  • 3. RAM
  • 4. Hard Drive
  • 5. External Storage
  • CD or DVD-ROM
  • Flash Drive
  • Floppy Disk

35
Memory Volatile vs. Non-volatile
  • Volatile memory loses its contents when the
    computer is turned off
  • Non-volatile is preserved
  • Registers, cache, and RAM are volatile
  • They are used for temporary storage as programs
    execute
  • Actually involve electrical current (remember
    ON/OFF?)
  • Hard disk and external storage is non-volatile
  • They are used for permanent storage
  • Involve data being encoded into magnetic platters

36
Memory Speed
  • In order of speed
  • 1. Registers
  • 2. Cache
  • 3. RAM
  • 4. Hard Disk
  • 5. External Storage
  • However, each is successively larger.
  • For example, you never hear of a computer having
    more hard disk space than RAM. But RAM is
    faster! Wouldnt we want more of it? Why not
    all registers??
  • Theories?

37
Memory Size
  • What do we mean when we say a computer has a 200
    GB hard drive?
  • 1 bit a zero or one
  • 1 B 8 bits
  • Giga 109
  • So that means that our hard drive can hold
    200109 B, which is 8200109 bits.
  • This is 1.6 trillion bits.

38
Memory Size
  • Question to ponder.
  • Given what we know about RAM
  • It is used temporarily as programs execute
  • It is faster than hard disk
  • It is also more expensive
  • The size of a hard disk does not typically affect
    the speed of a computer. But the size of RAM
    does.
  • Lets take a few minutes and think this through.
    Why might this be the case?

39
In Summary
  • Heres what happens when a program runs on a
    computer

40
Abstraction
  • Abstraction is a way of thinking about something
    which hides complexities.
  • Essence of computing
  • To drive a car, we need only know a few things
  • Gas petal, brake petal, gear shift, mirrors
  • But a lot actually happens under the hood
  • We dont need to know that to drive a car
  • By now, you should be realizing the same is true
    with a computer!
  • Examples of abstraction? Weve been through
    some.
Write a Comment
User Comments (0)
About PowerShow.com