Docsity

Abstract Data Structures, Java and Life of Software - Lecture Slides | CS 230, Assignments of Data Structures and Algorithms

Toggle sidebar
bg1
1
1 - 1
CS230: Data Structures
Spring 2007
Reading: Downey: Chapters 1, 2, 3, Sections 4.1-4.7, 4.13, 4.15-4.17, C hapters 5 and 6
Problem Set: Problem Set #1 due Tuesday, February 13
Monday, January 29, 2007
Handout #2
1 - 2
Objectives of CS230
• Teach main ideas of programming
– Data abstraction
– Modularity
– Performance analysis
– Standard abstract data structures (ADTs)
• Make you a more competent programmer
– Designer, tester, analyzer, debugger
• Help you develop a project worth showing off
• Have fun in the process
pf3
pf4
pf5

Partial preview of the text

Download Abstract Data Structures, Java and Life of Software - Lecture Slides | CS 230 and more Assignments Data Structures and Algorithms in PDF only on Docsity!

1 - 1

CS230: Data Structures

Spring 2007

Reading: Downey: Chapters 1, 2, 3, Sections 4.1-4.7, 4.13, 4.15-4.17, Chapters 5 and 6 Problem Set: Problem Set #1 due Tuesday, February 13

Monday, January 29, 2007

Handout

1 - 2

Objectives of CS

• Teach main ideas of programming

– Data abstraction

– Modularity

– Performance analysis

– Standard abstract data structures (ADTs)

• Make you a more competent programmer

– Designer, tester, analyzer, debugger

• Help you develop a project worth showing off

• Have fun in the process

1 - 3 Why ADTs?

  • Allow you to write complex programs easier
    • To keep mental track of complex data interaction
    • To reuse code (yes!)
    • To improve code performance
  • Allows modularity of large projects
    • Easier to understand large chunks of code
    • Easier to collaborate with large teams
  • To combat Sergeant Spaghetti Code 1 - 4 For example…
  • Create a hangman program
  • Here is the GUI
  • Need a way of managing words
  • Create a new set of words
  • Add a new word
  • Delete a used word
  • Check if the set is empty
  • Grab a random word from the bag

1 - 7 Efficiency Matters in this Course! E.g.: I’m thinking of an integer between 1 and 1000. I will tell you if any guess is low, high, or correct. What’s the minimum number of guesses you need? This is the key idea behind binary search. Can use binary search to quickly find items in a sorted array: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

1 - 8 Some Fundamental Data Structures

  • Array
  • Vector (growable array)
  • Linked list
  • Stack
  • Queue
  • Priority Queue
  • Set
  • Bag
  • Table
  • Tree
  • Graph

1 - 9 The Life Cycle of Software The life cycle of software as a water wheel that can rotate from one phase to any other phase 1 - 10 Writing, Compiling, and Running Java

  • Linux command to compile a Java program
    • javac Welcome.java
  • Linux command to run a Java program
    • java Welcome

public class Welcome {

public static void main ( String args[]) {

System.out.println(“Welcome to CS230!”);