public class Book
cfw_ private int numberPages;
private double cost;
private String title;
public Book( )
cfw_ numberPages = 0;
cost = 0.0;
title = "none";
public Book(int newNumberPages, double newC
More examples of invariants
CS 5010 Program Design Paradigms
Bootcamp
Lesson 7.2
Mitchell Wand, 2012-2015
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International Li
Case Study: Undefined Variables
CS 5010 Program Design Paradigms
Bootcamp
Lesson 7.4
Mitchell Wand, 2012-2016
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 Internationa
When do I need an invariant?
CS 5010 Program Design Paradigms
Bootcamp
Lesson 7.3
Mitchell Wand, 2012-2016
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International L
Foldr and Foldl
CS 5010 Program Design Paradigms
Bootcamp
Lesson 7.5
Mitchell Wand, 2012-2014
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
1
Les
Solving Your Problem by
Generalization
CS 5010 Program Design Paradigms
Bootcamp
Lesson 7.1
Mitchell Wand, 2012-2015
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 Inter
Lists of Structures
CS 5010 Program Design Paradigms
Bootcamp
Lesson 4.3
Mitchell Wand, 2012-2014
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
1
More Recursive Data Types
CS 5010 Program Design Paradigms
Bootcamp
Lesson 4.4
Mitchell Wand, 2016
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
Why Recursive Functions Halt
CS 5010 Program Design Paradigms
Bootcamp
Lesson 4.6
Mitchell Wand, 2016
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International Licens
Non-Empty Lists
CS 5010 Program Design Paradigms
Bootcamp
Lesson 4.5
Mitchell Wand, 2012-2014
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
1
Les
Using the List Template
CS 5010 Program Design Paradigms
Bootcamp
Lesson 4.2
Mitchell Wand, 2012-2014
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International Licens
CSC 122 Data Structures
Homework Assignment #4 Binary Search Trees
Due Monday, May 5, at the beginning of class
1. Show the tree that would result from inserting a 15 into this tree.
Value = 15
2. Sho
CSC 122 Introduction to Data Structures
Exam #1 February 22, 2013
Solutions
QUESTION 1 C+ OUTPUT (6
POINTS)
In the box provided, show the output of the following C+ program.
void homer( )
cfw_
cout <
import java.util.ArrayList;
/*
* A class used for practicing ArrayLists
*
* @author Queen
* @version November 2010
*/
public class ArrayListPractice
cfw_
private ArrayList <Book> library;
/*
* Constru
CSC 122 Introduction to Data Structures
Practice Exam #3
This exam is actually a compilation of questions from previous semesters
of this class. This exam is not meant to illustrate what a complete ex
CSC 122 Data Structures
Homework Assignment #3 Algorithm Analysis
Solutions
1. Calculate the O( ) value for each of the following expressions:
12n2 + 9n + 24
(a)
O( n2 )
(b)
27n lg n + 46n + 193
O( n
CSC 122 Introduction to Data Structures
Exam #1 February 22, 2013
For this exam, you can use one sheet of notes (front and back). Other than
that, this exam is closed-book, closed-notes, and closed-ne
CSC 122 Introduction to Data Structures
Practice Exam #3
Solutions
1. Write a C+ function named sumUp that takes one parameter, an integer n. You can assume
that n is positive (1 or more). The functio
CSC 122 Introduction to Data Structures
Practice Exam #2 Solutions
1. Write a C+ function named sumUp that takes one parameter, an integer n. You can assume
that n is positive (1 or more). The functio
CSC 122 Data Structures
Practice Problems #1
1. What output is produced by the following program? Spacing is not important,
except for line breaks.
#include <iostream>
using namespace std;
void status
Software Requirements
Specifications
for
Solitaire
Version 1.0
Group 1
1. Introduction
1.1 Purpose
To entertain the user. Also to follow the rules set by standard solitaire.
1.2 Intended Audience
The
Use Cases:
Start a new game
1. User clicks on the start button
2. User clicks new game button
3. The cards will shuffle with a new deck
4. The deck deals the cards
5. Wait for user to make a move
Vari
CSC 122 Data Structures
Final Exam Fall 2012
Solutions
You are allowed to use two standard-sized pieces of paper for notes for this exam;
other than this, the exam is closed-book, closed-notes, and cl
CSC 122 Data Structures
Homework Assignment #3 Algorithm Analysis
Due Wednesday, April 23, by the beginning of class
1. Calculate the O( ) value for each of the following expressions:
O( n2 )
(a)
12n2
CSC 122 Data Structures
Practice Problems #1
Solutions
1. What output is produced by the following program?
important, except for line breaks.
#include <iostream>
using namespace std;
void status () c