Assignment/Homework #1
COP-3530, Summer C 2016
Instructor: Dr. Antonio L. Bajuelos
Rules & Instructions:
Due date: Tuesday, May/31/2016 at 5 p.m. (Eastern Time)
This assignment has 2 problems.
The assignment/homework will be submitted by email to
Your sub
Assignment/Homework #1
COP-3530, Spring 2016
Instructor: Dr. Antonio L. Bajuelos
Rules & Instructions:
Due date: Wednesday, Jan/27/2016 at 5 p.m. (Eastern Time)
This assignment has 3 problems.
The assignment/homework will be submitted by email to abajuelo
Assignment/Homework #2
COP-3530, Fall 2015
Instructor: Dr. Antonio L. Bajuelos
Rules & Instructions:
This assignment has 3 problems.
Due date: Saturday, October 3, 2015 at 5 pm (Eastern Time)
The assignment/homework will be submitted by email to abajuelo@
COP-3530, Spring 2016, Section: U01
Data Structures, Midterm Exam #1
(proposed solutions)
1. reverseList, shown below, places items in the first list (of the size N) into the second list
in reverse order.
public void reverseList( List original, List rever
COP 3530
Section U01
Fall 2011
Midterm Exam
INSTRUCTIONS
1. This test is open book, open notebook. You can also use the practice
exams and your programs.
2. You cannot use computers, calculators, or cellphones.
3. If you need to use the bathroom, do it be
Algorithm Analysis
Examples Notes
Instructor: Dr. Antonio L. Bajuelos
Fibonnaci Numbers: Recursion vs Iteration?
Recursive Approach:
public static long fib( int n )
cfw_
if( n <= 2 )
return 1;
else
return fib( n - 1 ) + fib( n - 2 );
But while Elegant,
STACKS - DEFINITION
A stack is a LIFO list i.e.
Addition and removal takes place only at one end,
called the top
STACK - MAIN OPERATIONS
push(x): add an item on the top
pop: remove the item at the top
peek: return the item at the top (without removin
Sorting (II)
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not to be
published or publicl
a+b*c+(d*e+f)*g
Next a * is read. The top entry on the operator stack has lower precedence than *, so
nothing is output and * is put on the stack.
a+b*c+(d*e+f)*g
a+b*c+(d*e+f)*g
a+b*c+(d*e+f)*g
a+b*c+(d*e+f)*g
The next symbol is a +. Checking the stack,
HASHTABLE JAVA UTIL
(source: http:/www.java2novice.com/java-collections-and-util/hashtable/)
Below example shows basic operations on Hashtable like creating hashtable object, adding key-value
pair, getting the value based on key, checking hashtable is emp
Hashing
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not to be
published or publicly dis
Sorting (I)
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not to be
published or publicly
Algorithm Analysis
Examples
Instructor: Dr. Antonio L. Bajuelos
Algorithm Analysis. Example #1
1
Algorithm Analysis. Example #2
Algorithm Analysis. Example #3
The first line is O(1).
The for loop is repeated n times.
The third line takes O(1).
The tot
Algorithm Analysis
(I)
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not to be
published
Assignment/Homework #1
COP-3530, Fall 2015
Instructor: Dr. Antonio L. Bajuelos
Rules & Instructions:
This assignment has 3 problems.
Due date: Thursday, September 10th, 2015 at 4 pm (Eastern Time)
The assignment/homework will be submitted by email to abaj
AVL Trees
(Adelson-Velskii and Landis)
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not
Priority Queues
(Heaps)
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not to be
published
B-Trees
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not to be
published or publicly dis
Trees (I)
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not to be
published or publicly d
The Queue ADT
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not to be
published or public
The Stack ADT
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not to be
published or public
The List ADT
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not to be
published or publicl
Algorithm Analysis (II)
Dr. Antonio L. Bajuelos
Note: The most of the information of these slides was extracted and adapted from Weisss book, Data
Structures and Algorithm Analysis in Java". They are provided for COP3530 students only. Not to be
published
/Build a Heap Sort
/Heap is in array structure
import java.util.*; /we need Array Lists
Public class Heapcfw_
ArrayList<Integer> arr = new ArrayList<>();
/* public class Nodecfw_
public void Node(int value)cfw_
int data = value;
Node left = null;
Node rig
/*
Recursive Method that writes a given array backward. Cosidering last element of
the array first.
*/
import java.util.Scanner;
/main class
public class A1_P1
cfw_
/main method
public static void main(String[] args)
cfw_
/initialize array w/ int ty
Algorithm Analysis
Examples (II)
Instructor: Dr. Antonio L. Bajuelos
Algorithm Analysis. Example #1
1
Algorithm Analysis. Example #2
Algorithm Analysis. Example #3
The first line is O(1).
The for loop is repeated n times.
The third line takes O(1).
Th
Algorithm Analysis
Examples Notes (I)
Instructor: Dr. Antonio L. Bajuelos
Fibonnaci Numbers: Recursion vs Iteration?
Recursive Approach:
public static long fib( int n )
cfw_
if( n <= 2 )
return 1;
else
return fib( n - 1 ) + fib( n - 2 );
But while Elega
/*Homework # 2
Description:
constant e.
Program to compute and print the value of the mathematical
Author: Pedro Ramos
PI # 5727447
Due Date: 02/09/2016
Certification:
I hereby certify that this work is my own and none of it is work of any other
person.
P
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File:
main.c
* Author: lazaroalvarez
*
* Created on February 6, 2016,
Pedro Ramos
Panther ID# 5727447
CAP 4770 U01
Midterm Questions
1. Which of the following is not a data mining functionality?
A) Characterization and Discrimination
B) Classification and regression
C) Selection and interpretation
D) Clustering and Analysis
#include <stdlib.h>
#include "bmplib.h"
/*
* This method enlarges a 24-bit, uncompressed .bmp file
* that has been read in using readFile()
*
* original - an array containing the original PIXELs, 3 bytes per each
* rows
- the original number of rows
* col