Presentation for use with the textbook Data Structures and
Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia,
and M. H. Goldwasser, Wiley, 2014
Shortest Paths
A
8
0
4
2
B
8
2
2014 Goodrich, Tamassia, Goldwasser
Shortest Paths
7
5
E
C
3
2
1
CSE2100: Data Structures and Introduction to Algorithms
Homework Assignment #4 Sample Solutions
Exercise 1 Problem R-11.3, page 525 of the text
Solution: 5 (2 with 1 as root, 1 with 2 as root, and 2 with 3 as root).
Exercise 2 Give a linear-time algorithm
A Heap(ing) Portion
1. Insert the items into a heap (that is initially empty) in the order given
below:
12, 6, 20, 11, 7, 9, 15, 10, 3
Draw the heap after each insertion. Give a vector representation of the
heap after the last item has been inserted.
2. C
Union-Find Partition Structures
Partitions with Union-Find
Operations
makeSet(x): Create a singleton set containing
the element x and return the position storing x
in this set
union(A,B ): Return the set A U B, destroying
the old A and B
find(p): Return t
A Question of Some Depth
Let T be a k-ary tree, i.e. each internal node of T has at most k children.
Suppose that the depth of T is d (the maximum depth of any node of T is
d). What is the maximum number of external nodes (leaves) that T can have?
What is
CSE 2100 Sample Mid-Term Exam #2
True or False with brief explanation
(a) The worst-case height of a binary search tree is O(log n)
(b) A preorder traversal of a binary heap yields the keys in non-decreasing order
(c) The quicksort algorithm described in
Solutions to Exercises related to Sorting
Note: As you might suspect, these exercises can be solved essentially
using a variation of the MergeSort or (randomized) QuickSort algorithms.
1. Suppose that S is a set of n integers. Describe an efficient algori
Asymptotic notation
Put these functions in order so that if f (n) O(g(n) (i.e. f (n) is Big-Oh
of g(n), then f (n) appears before g(n) in the list. Group together functions
that have the same asymptotic order of growth (i.e. f (n) g(n).
n2 , n log n, n3 +
CS 341: Chapter 1
1-2
Chapter 1
Regular Languages
CS 341: Foundations of CS II
Contents
Finite Automata
Class of Regular Languages is Closed Under Some Operations
Marvin K. Nakayama
Computer Science Department
New Jersey Institute of Technology
Newark,
Shayan Rizvi
Written Assignment 3
11-29-11
1. 1-bit Half Adder
1-bit Full Adder
1-bit Carry look-ahead (CLA) Adder
Where in the 1-bit CLA adder and
The sum is represented the same for the one bit full adder and the one bit carry lookahead adder. There are
CSE 2300W: Lab 7 4-bit ALU
Section Number: Thursday 10-12pm
Name: Shayan Rizvi
ObjectivesIn this lab, you will build a 4-bit ALU. When solving many real-world problems,
you need to work from vague, possibly inconsistent, and informal specifications. This
CSE 2300W: Lab 7 4-bit ALU
Section Number: Thursday 10-12pm
Name: Shayan Rizvi
Objectives
The purpose of this lab is to create a 4-bit ALU. You want to build this ALU to preform
bitwise OR operation, bitwise AND operation, bitwise NAND operation, bitwise
CSE 2300W: Lab 5 & 6 Display 5 bit Binary Numbers in
Decimal
Section Number: 7 (Thursday 10am 12pm)
Name: Shayan Rizvi
Objectives
The purpose of this lab is to design a circuit that will convert and display a 5 bit binary
number into a decimal number. Thi
CSE 2300W: Lab 4 Relational Operators
Section Number: _
Name: Shayan Rizvi
Objectives
The purpose of this lab was to design and implement a circuit that compares two binary
inputs where each binary input has two bits. These two inputs were compared using
CSE 2300W: Lab 3 Overflow
Section Number: _
Name: Shayan Rizvi
Objectives
The objective of this lab is to detect overflow in the addition of twos compliment
numbers. Sometimes when one adds together two twos compliment binary numbers
there is an overflow
CSE 2300W: Lab 2 Number Conversion
Section Number: _
Name: Shayan Rizvi
Objectives
The main objective of this assignment is to take a 4 bit binary number and convert it into
various types of number systems. The number systems that will be used are decimal
CSE 2300W LAB 1 Sample Lab Report
How to Change a Flat Tire
Section Number 001
Name Shayan Rizvi
Objectives
The tires of a car should be replaced about every six years. Although occasionally one
might get a flat tire before the life of the tire expires. T
CSE 5102
Programming Languages
Lecture 1
Monday, August 30, 2010
1
Overview
Administrative details Course objective
Why study programming languages ? Syllabus
The Beginning
Lecture 1
Monday, August 30, 2010
2
Administrative Details
The material for