/*
* Write a description of class insertSort here.
*
* @author (your name)
* @version (a version number or a date)
*/
/ insertSort.java
/ demonstrates insertion sort
/ to run this program: C>java InsertSortApp
// @author : Scott Paillant
/ Date : 2/5/201
Stack



Special type of linked list data structure in which data is added and removed at only one
end called the top
To add an item to the stack it must be placed on the top of the stack
To remove an item from the stack, it must be removed from the to
Chapter 2
Instructions: Language of
the Computer
The repertoire of instructions of a
computer
Different computers have different
instruction sets
But with many aspects in common
Early computers had very simple
instruction sets
2.1 Introduction
Instruction
/*
* Write a description of class OrderedArray here.
*
* @author Scott Paillant
* @version 1/28/2015
*/
public class OrderedArray
cfw_
/ orderedArray.java
/ demonstrates ordered array class
/ to run this program: C>java OrderedApp
/
private long[] a;
/ re
/ linkStack.java
/ demonstrates a stack implemented as a list
/ to run this program: C>java LinkStackApp
/
/
/*
*
* @author Scott Paillant
*
Date: 2/26/2015
*/
public class LinkStack
cfw_
public static void main(String[] args) throws Exception
cfw_
System
/*
*
* @author Scott Paillant
* Date: 2/19/2015
*/
public class ArrayQueueApp extends ArrayQueue
cfw_
public ArrayQueueApp(int size)
cfw_
super(size);
public static void main(String[] args)
cfw_
ArrayQueue first = new ArrayQueue(100);
first.insert(1);
fi
public class ArrayQueue implements QueueADT
cfw_
private Object[] itsItem;
private int itsFront; /location of front element, if any
private int itsRear; /location of rear element, if any
public static void main(String[] args)
cfw_
public ArrayQueue(int s
/*
*
* @author Scott Paillant
* Date: 2/19/2015
*/
public class ArrayStackApp extends ArrayStack
cfw_
public ArrayStackApp(int size)
cfw_
super(size);
public static void main(String[] args)
cfw_
ArrayStack first = new ArrayStack(100);
first.push(1);
firs
/ linkQueue.java
/ demonstrates queue implemented as doubleended list
/ to run this program: C>java LinkQueueApp
/
/
/*
*
* @author Scott Paillant
*
Date: 2/26/2015
*/
public class LinkQueue
cfw_
public static void main(String[] args)
cfw_
System.out.pri
/*
* Write a description of class HighArray here.
*
* @author Scott Paillant
* @version 1/27/2015
*/
/ highArray.java
/ demonstrates array class with highlevel interface
/ to run this program: C>java HighArrayApp
/
class HighArray
cfw_
private long[] a;
Chapter 3 : Sequential Logic Design
Digital Design and Computer Architecture
David Money Harris and Sarah L. Harris
Copyright 2007
3<1>
Chapter 3 : Topics
Introduction
Latches and FlipFlops
Synchronous Logic Design
Finite State Machines
Timing of Sequen
Chapter 2 : Combinational Logic Design
Digital Design and Computer Architecture
David Money Harris and Sarah L. Harris
Copyright 2007
2<1>
Chapter 2 : Topics
Introduction
Boolean Equations
Boolean Algebra
From Logic to Gates
Multilevel Combinational Logi
A tree is a nonlinear structure with a unique starting node (the root), in which each node is
capable of having many successor nodes, called children.
Root is The top node of a tree structure; a node with no parent
Leaf is a tree node that has no children
Abstraction
 tool to manage complexity
Hide irrelevant details  the programmer can focus on the features needed to use a
thing
 Examples
File deletion using icons
The brakes on a car
The control panel of Windows XP
The television remote
Data Type

Queue





A first in first out data structure
The first item into the queue is the first out of it
Like a line of people waiting for a bank teller
New people must enter the queue at the rear. Usually called an enqueue operation
When an item is taken
Deletion Algorithm
 The deletion is complex however. It spreads deletions throughout the tree by
redistributing and/or merging nodes when they become empty.

Deleting item X
o Locate node n, which contains item X
o If node n is not a leaf (an internal n
Binary Search Tree Problem
 One major problem with the binary search trees we have discussed thus far
o they can become extremely unbalanced this will lead to long search time
 In the worst case, if insertions are done in order
o this will lead to a lin
Sorting



An operation that segregates items into groups according to specified criterion
Examples
o Sorting books in library
o Sorting individuals by height
o Sorting numbers
Types of sorting Algorithms
o Bubble sort
Compares adjacent array elements
Hashing



Technique that provides faster search results
Balanced search trees guarantees search path by controlling height of the search tree
o AVL tree
o 2 3 tree(Btree)
Allows for O(1) search performance
o Search time does not increase as n increa
Priority Tree
 A completed binary tree with the following properties
o Each of the parent nodes contains value that is greater than or equal to the
value of each of its children
o The root of the priority tree always contains the highest value
A binary t
Clustering Analysis is a process to organize the data (items) in such a way that the items in
the same cluster share some common characteristics (features)
Three major steps in Clustering Analysis:
Indexing
Clustering
Query Matching
Indexing is a proce
Introduction to Logic
By Paul Herrick (Oxford University Press, 2012)
Student Workbook
This document is divided into two parts. Part One contains
supplementary materials created by Paul Herrick and Mark
Storey, under a grant from the Bill and Melinda Gate
CHAPTER 2
Arrays
An array is an object that consists of a sequence of elements that are numbered 0, 1, 2, . . . The
element numbers are called index numbers. Array elements can be accessed by their index
numbers using the subscript operator [], as a[0], a
Chapter 3
Arithmetic for Computers
Operations on integers
Addition and subtraction
Multiplication and division
Dealing with overflow
3.1 Introduction
Arithmetic for Computers
Floatingpoint real numbers
Representation and operations
Chapter 3 Arithmetic f