Algorithms and Data Structures
Chapter 2
Catherine Durso
cdurso@cs.du.edu
Algorithms and Data Structures p. 1/41
Chapter 2
Chapter 2 provides an overview of the analysis of an
algorithm correctness and the analysis of an
algorithmss asymptotic running tim
Problem Set 3, Comp 2370 Fall 2015
Please turn in your solutions to problems 1 and 2.
0. For fun, and no points, search "recursion" in Google.
1. Chapter 3 includes the assertion that ! % . The goal of this exerci
Problem Set 2, Comp 2370 fall 2015
Please turn in your solutions to problems 1 through 10.
Background: The discrete Fourier transform, or DFT, is an important tool in signal processing. In the case of a
signal sampl
Problem Set 1, Comp 2370 fall 2015
Please turn in your solutions to problems 1 and 2.
1. The following pseudocode specifies an algorithm intended to calculate the mean of a non-empty array A of
real numbers (floats)
ANSWER KEY
COMP2370 Section 3, Fall 2014
FINAL EXAM
Nov. 17, 2014, 10:00-11:50am
You can have any color as long as it's black.
Henry Ford, unsuccessfully attempting to solve Question 2c
Directions:
By taking this exam you agree not to disclose any in
ANSWER KEY
COMP2370 Section 1, Fall 2014
FINAL EXAM
Nov. 17, 2014, 2:00-3:50pm
You can have any color as long as it's black.
Henry Ford, unsuccessfully attempting to solve Question 1a
Directions:
By taking this exam you agree not to disclose any info
1. Lecture II : ADT Specification & Impl.
2. Lecture V : Reference Types and Linked Lists [Given in Class]
3. Lecture VI : Analysis of Algorithms [Will be provided in Class]
4. Lecture VII : Stacks and Queues
5. Lecture VIII: Trees ADT
LECTURE ONE: ABSTRACT DATA TYPES (ADTs)
RECALL
DATA TYPES
Recall: A type is a named construct that specify a set of values and a set of allowable operations that can be
carried out on them. A data type is a classification identifying one of various types
ICS 2105: Data Structures and Algorithms
Searching and Sorting Algorithms
Searching Algorithms
Given a list L of n elements, the task is to check whether another number m is in the list, i.e. whether m is
an element in the list. This is a simple search pr
LECTURE ONE: ABSTRACT DATA TYPES (ADTs)
RECALL
DATA TYPES
Recall: A type is a named construct that specify a set of values and a set of allowable operations that can be
carried out on them. A data type is a classification identifying one of various types
RECURSION
Recall
Problem solving steps:
1) Identify a real world problem e.g. finding the maximum of n numbers;
Note that real world problems are not CS problems, our first task is to convert the problem
into a CS problem i.e. computers work on computatio
DATA STRUCTURING CASE STUDIES
Case Study One (1)
Finding the Maximum and Minimum of n integers
How would we approach this task?
First; from our previous knowledge; the following are independent codes for obtaining maximum
and minimum separately.
int max=n
DATA STRUCTURING CASE STUDIES
Case Study Two (II)
Finding the Maximum and Next Maximum of n integers
From the problem of obtaining the max and min in CASE study one; we can obtain the
maximum of n numbers in n-1 mandatory comparisons; one approach to obta
APP 1: PROCEDURAL ABSTRACTION PARAMETERISED PERSPECTIVE
ABSTRACTION
Abstraction is a mode of thought by which we concentrate on the general ideas rather than on the
specific manifestations of these ideas.
In programming, abstraction refers to the distinct
VARIABLES
-These are placeholders in memory for unknown values during the
execution of an application.
-They are named storage locations in computer's memory that can contain
data that can be modified during program execution.
Variables have a name, the w
Data Structures and Algorithms: LAB ONE [1]
Aims
To refresh the knowledge of Simple data structures such as arrays and structs
To introduce the concept of UML notations used for ADT specification
To cement knowledge of ADT specification and implementat