Starting from:

$35

Elementary Data Structures and Algorithms Assignment 6A 6B

Elementary Data Structures and Algorithms
Assignment 6A

Assignment 6A Skills
Lists
Assignment 6A Background
For this assignment you will be writing classes for lists that store integers.
Assignment 6A Requirements
1. (20%) Write a class called ArrayList that uses an integer array to store a list of integers. It should
implement methods for the following operations:
(a) emptying the list
(b) adding a new element at the beginning of the list.
(c) adding a new element at the end of the list.
(d) adding a new element at a specified position in the list.
(e) removing an element from the beginning of the list.
(f) removing an element from the end of the list.
(g) removing an element from a specified position in the list.
(h) determining if the list contains a specified value.
(i) count the number of occurences of a specified value.
2. (10%) Write a class called Node. This class should include the following:
(a) an private integer for the stored data.
(b) a private Node reference for the next link.
(c) Constructors/getters/setters as necessary.
3. (20%) Write a class called LinkedList that uses linked data to store a list of integers. It should
implement methods for the same operations as the ArrayList class.
Assignment 6A Submission Submit on Blackboard:
1. Node.java
2. ArrayList.java
3. LinkedList.java
Required Each submitted file should include your name and a statement that this is your own work. This
should appear as a comment at the beginning of any code file.

CSC 230 Elementary Data Structures and Algorithms
Spring 2014 - Assignment 6B
Due Thursday, April 17, 2014, 5:30pm
Assignment 6B Skills
Big-Oh Analysis
Assignment 6B Background
For this assignmnet you will be analyzing several algorithms to determine their running-time efficiency
in terms of Big-Oh.
Assignment 6B Requirements
Provide a Big-Oh analysis for each of the following code segments.
1.)
a = 5 ;
b = 3 ;
c = a ∗ b ;
2.)
for ( i =0; i<n ; i++) {
a+=1;
}
3.)
for ( i =0; i<n ; i++) {
a+=i ;
}
4.)
for ( i =0; i<n ; i++) {
for ( j =0; j<n ; j++) {
a+=1;
}
}
5.)
for ( i =0; i <(n / 2 ) ; i++) {
a+=i ;
}
6.)
for ( i =0; i<n ; i++) {
a+=1;
}
for ( j =0; j<n ; j++) {
a+=1;
}
7.)
for ( i =0; i<n ; i++) {
for ( j =0; j<n ; j++) {
a+=1;
}
}
for ( k=0; k<n ; k++) {
a+=1;
}
8.)
for ( i =0; i<n ; i++) {
for ( j =0; j<n ; j++) {
for ( k=0; k<n ; k++) {
a+=1;
}
}
}
9.)
i f ( x==2) {
y=3;
} e l s e {
y=0;
}
10.)
i f ( x==0) {
y=0;
} e l s e {
for ( i =0; i<n ; i++) {
y+=1;
}
}
Assignment 6B Submission Submit in class:
A hardcopy of your analysis. You must show all work.
Required Each submitted file should include your name and a statement that this is your own work.

More products