SlideShare una empresa de Scribd logo
1 de 30
ECET 370 Entire Course (Devry)
For more course tutorials visit
www.ecet370.com
ECET 370 Week 1 Lab 1
ECET 370 Week 2 Lab 2
ECET 370 Week 3 Lab 3 Linked Lists
ECET 370 Week 4 Lab 4 Complexity of Computational Problems
ECET 370 Week 5 Lab 5 Search Algorithms and Techniques
ECET 370 Week 7 Lab 7 Binary Trees
================================
ECET 370 Week 1 iLab Array Based
Implementations (New Syllabus)
For more course tutorials visit
www.ecet370.com
ECET 370 Week 1 iLab Array-Based Implementations
iLAB OVERVIEW
Scenario and Summary
The purpose of the iLab exercises is to help the student acquire skills
in developing programs that require implementation with arrays of
abstract data types, such as lists and bags.
Note!Software Citation Requirements
This course uses open-source software which must be cited when
used for any student work. Citation requirements are on theOpen
Source Applications page.
Please review the installation instruction files to complete your
assignment
Deliverables
There are four exercises in this iLab, although not all of them will be
required for submission. Be sure to read the following instructions
carefully.
Exercise 1: No submission is required.
Exercise 4 contains parts a, b, c and continues through part i. Keep in
mind that the methods developed for each of these parts should be
within the same bag class.
Create a folder and name it Week 1 iLab. Inside this folder, create the
subfolders Ex2, Ex3, and Ex4. Place the solution to each of the three
exercises required for submission in the corresponding subfolder.
Compress the folder Week 1 iLab, and drop the resulting zipped
folder into the Dropbox.
Note that Exercises 2, 3, and 4 require software development. Place in
the corresponding folders only .java files. Do not submit the .class
files or other files or folders that are generated by the IDE.
Required Software
Eclipse
Access the software at https://lab.devry.edu .
iLAB STEPS
Exercise 1: Review of Array-Based Lists
Back to Top
Create a project using the classes in this zip file and name it "A
Simple ArrayList Class." Compile it, run it, and review the code that
is given carefully. This code tests the ArrayList class discussed in the
lecture.
Exercise 2: Implementing an Array List
Back to Top
Modify the class ArrayList given in Exercise 1 by using expandable
arrays. That is, if the list is full when an item is being added to this
list, the elements will be moved to a larger array. The new array
should have twice the size of the original array.
Exercise 3: Using an Array-Based List
Back to Top
Using the class ArrayList completed in the previous exercise, write a
program to store 1,000 random numbers, each in the interval [0, 500].
The initial size of the array in the class should be set to 100. Print the
numbers.
Exercise 4: Implementing a Bag Class
Back to Top
Create a class bag (multiset) that uses an expandable array to store the
bag items. The item type must be a Java String type; that is, the bag
will store strings of characters. The class should have the methods
listed below. Create a main class to test your bag class. This main
class should fill a bag with the keywords of the Java language.
1. Bag(): default constructor
2. booleanisEmpty(): determines whether the bag is empty
3. void print(): prints the bag elements
4. intgetLength(): returns the number of items in the bag
5. void clear(): removes all of the items from the bag
6. void add(String item): adds an item to the bag
7. voidremoveOne(String item): removes item from the bag; only
one occurrence of item should be removed.
8. voidremoveAll(String item): removes item from the bag; all
occurrences of item should be removed.
9. int count(String item): counts the number of occurrences of item
in the bag
================================
ECET 370 Week 1 Lab 1 (Devry)
For more course tutorials visit
www.ecet370.com
General Instructions
Exercises 1, 2, 4, and 5 use the programs in DocSharinglabeled
“User-defined classes."
Exercises 7 and 8 use the programs in DocSharinglabeled “Using
interfaces."
Exercise 1: Review of classes Create a project using the classes in the
DocSharing area labeled “User-defined classes." Compile it, run it,
and review the code that is given carefully.
Exercise 2: User-defined methods The function area of the Triangle
class is the framework of the actual method. Modify it so that it
calculates the area of the triangle. Write a Main class to test your area
method. Note: to calculate the area of a triangle from the vertices, first
find the distances between each pair of vertices to obtain the length of
the sides of the triangle. Then apply Heron’s formula to calculate the
area given the length of the sides.
Exercise 3: Shallow versus deep copy Provide an example of shallow
copy of objects and an example of deep copy of objects.
Exercise 4: Passing parameters to methods Write a function that
swaps two Point objects. Use the code given below: import java.util.*;
public class Main { public Main() { Scanner Scanner(System.in);
System.out. print("Enter x and y coordinates of first point: "); Point
Point (in.nextDouble(), in.nextDouble()); System.out. print("Enter x
and y coordinates of second point: "); Point Point (in.nextDouble(),
in.nextDouble()); swap(p1, p2); System.out.println(" Compile it, run
it, and review the code that is given carefully. Note: The class Point
implements the Comparable interface. The Comparable interface
contains a single method: compareTo, which is used to compare two
objects p and q of the same class type. When calling p.compareTo(q),
it returns an integer. If this value is negative it means that p is smaller;
if it is equal to zero then , and if the value is positive, it indicates that
p is greater than q.
Exercise 8: Implementation of interfaces Using the class Point in the
DocSharing area labeled “Using interfaces," write an application that
declares an array of Points, fills the array with random points, and
finds the smallest point in the array.
================================
ECET 370 Week 2 ilab Linked Lists (New Syllabus)
For more course tutorials visit
www.ecet370.com
ECET 370 Week 2 ilab Linked Lists
iLAB OVERVIEW
Scenario and Summary
The purpose of the iLab exercises is to help the student acquire skills
in developing programs that require the implementation with linked
lists of abstract data types, such as lists and bags.
Deliverables
There are four exercises in this iLab, although not all of them will be
required for submission. Be sure to read the following instructions
carefully.
Exercise 1: No submission is required.
Exercise 4 contains Parts a, b, c, d, e, f, g, and h. Keep in mind that
the methods developed for each of these parts should be within the
same bag class.
Create a folder and name it Week 2 iLab. Inside this folder, create the
subfolders Ex2, Ex3, and Ex4. Place the solution to each of the three
exercises required for submission in the corresponding subfolder.
Compress the folder Week 2 iLab, and drop the resulting zipped
folder into the Dropbox.
Note that Exercises 2, 3, and 4 require software development. Place in
the corresponding folders only .java files. Do not submit the .class
files or other files or folders that are generated by the IDE.
Required Software
Eclipse
Access the software at https://lab.devry.edu .
iLAB STEPS
Exercise 1: Review of Linked Lists
Back to Top
Create a project using the classes in "A Simple LinkedList Class."
Compile it, run it, and review the code that is given carefully. This
code tests the LinkedList class provided in the lecture.
Exercise 2: Implementing a Doubly Linked List
Back to Top
Modify the class LinkedList in Exercise 1 to make it a doubly linked
list. Name your class DoublyLinkedList. Add a method addEnd to
add an integer at the end of the list and a method displayInReverse to
print the list backwards:
voidaddEnd(int x): create this method to add x to the end of the list.
voiddisplayInReverse(): create this method to display the list elements
from the last item to the first one.
Create a main class to test your DoublyLinkedList class.
Exercise 3: Using a Doubly Linked List
Back to Top
Using the class DoublyLinkedList completed in the previous exercise,
write a program to store all the prime numbers up to 100 in a
DoublyLinkedList object. The numbers should be stored in such a
way that when “display” is invoked, the listing will be shown in
increasing order: 2, 3, 5, 7, 11, 13, 17, … .
Exercise 4: Implementing a Bag Class
Back to Top
Create a class bag that uses a linked list to store the bag items. The
item type must be a Java String type, that is, the bag will store strings
of characters. The class should have the methods listed below. Create
a main class to test your bag class. This main class should fill a bag
with the keywords of the Java language.
1. . Bag(): default constructor
2. booleanisEmpty(): determines whether the bag is empty
3. void print(): prints the bag elements
4. intgetLength(): returns the number of items in the bag
5. void clear(): removes all of the items from the bag
6. void add(String item): adds an item to the bag
7. voidremoveOne(String item): removes an item from the bag;
only one occurrence of the item should be removed.
int count(String item): counts the number of occurrences of an item in
the bag.
(Note that you can reuse the code in Exercise 1 for the LinkedList
class to create your bag class. It will help you to save development
time.)
================================
ECET 370 Week 2 Lab 2 (Devry)
For more course tutorials visit
www.ecet370.com
General Instructions
Exercises 1, 2, and 3 use the programs in DocSharinglabeled “User-
defined array list."
Exercise 4 uses the programs in DocSharinglabeled “Using
java.util.ArrayList."
Exercise 1: Review of array-based lists Create a project using the
classes in the DocSharing area labeled “User-defined array list."
Compile it, run it, and review the code that is given carefully. This
code tests the ArrayList class provided in the lecture.
Exercise 2: A user-defined array list Modify the class ArrayList given
in the lecture by adding to it the functions listed below for Exercise 2.
In each case, the appropriate error message should be generated if an
invalid condition occurs. For example, an error message should be
generated when trying to insert an item in a given location in the list
and the location is out of range. a. ArrayList(int size): create a
constructor that sets the size of the array list to the value passed in
size (note that the class variable SIZE cannot be final anymore). b. int
length(): create this function to determine the number of items in the
list (accessor function). c. intgetSize(): create this function to
determine the size of the list (accessor function). d. void clear():
create this function to remove all of the items from the list. After this
operation, the length of the list is zero. e. void replace(int location, int
item): create this function to replace the item in the list at the position
specified by location. The item should be replaced with item. f. void
insert(int location, int item): create this function to add an item to the
list at the position specified by location. g. void remove(int item):
create this function to delete an item from the list. All occurrences of
item in the list should be removed. h. int get(int location): create a
function that returns the element at location. i. public ArrayList
copy(): create a function that makes a deep copy to another ArrayList
object.
Exercise 3: Using an array-based list Using the class ArrayList
completed in the previous exercise, write a program that uses it to
store 100 random numbers. Consider that each of these random
numbers is an integer in the interval [0, 200]. Write the program in
such a way that there are no number duplicates.
Exercise 4: Review of the library class java.util.ArrayList Create a
project using the classes in the DocSharing area labeled “Using
java.util.ArrayList." Compile it, run it, and review the code that is
given carefully. This code is the complete program given in our
lecture that tests the library class java.util.ArrayList.
Exercise 5: Using the library class java.util.ArrayList Rewrite
Exercise 3 (above) using the class java.util.ArrayList to store the 100
random numbers.
================================
ECET 370 Week 3 ilab The Stack and the Queue
ADTs (New Syllabus)
For more course tutorials visit
www.ecet370.com
ECET 370 Week 3 ilab The Stack and the Queue ADTs
iLAB OVERVIEW
Scenario and Summary
The purpose of the iLab exercises is to help the student acquire skills
in developing programs that involve the use of the stack and the
queue data structures.
Deliverables
There are six exercises in this iLab, although not all of them will be
required for submission. Be sure to read the following instructions
carefully.
Exercises 1 and 4: No submissions are required.
Create a folder and name it Week 3 iLab. Inside this folder, create the
subfolders Ex2, Ex3, Ex5, and Ex6. Place the solution to each of the
four exercises required for submission in the corresponding subfolder.
Compress the folder Week 3 iLab using a program like WinZip, and
drop the resulting zipped folder into the Dropbox.
Note that Exercises 2, 3, 5, and 6 require software development. Place
only .java files in the corresponding folders. Do not submit the .class
files or other files or folders that are generated by the IDE.
Required Software
Eclipse
Access the software at https://lab.devry.edu .
iLAB STEPS
Exercise 1: Review of the Stack ADT
Back to Top
Create a project using the classes in "A Simple Stack Class". Compile
the project, run it, and review the code that is given carefully. This
code tests the stack class provided in the lecture.
Exercise 2: An Improved Stack Class
Back to Top
Modify the stack class to include appropriate error messages if invalid
conditions occur—for example, trying to pop an item when the stack
is empty.
Exercise 3: Using a Stack in an Application
Back to Top
Complete Project 2 at the end of Chapter 5 in our textbook: Write a
Java program that uses a stack to test whether an input string is a
palindrome. Exercise 11 defines "palindrome" and asks you to
describe a solution to this problem. As you can see, you will need to
read Exercise 11 to find the meaning of palindrome.
To implement the solution to this problem, use the stack of characters
from the previous exercises (1 and 2).
Exercise 4: Review of the Queue ADT
Back to Top
Create a project using the classes in "A Simple Queue Class."
Compile the project, run it, and review the code that is given
carefully. This code tests the queue class provided in the lecture.
Exercise 5: An Improved Queue Class
Back to Top
Modify the class queue to include appropriate error messages if
invalid conditions occur—for example, trying to dequeue an item
when the queue is empty.
Exercise 6: Using a Queue in an Application
Back to Top
Complete Project 4 at the end of Chapter 10 in our textbook:Simulate
a small airport with one runway. Airplanes waiting to take off join a
queue on the ground. Planes waiting to land join a queue in the air.
Only one plane can use the runway at any given time. All planes in
the air must land before any plane can take off.
================================
ECET 370 Week 3 Lab 3 Linked Lists (Devry)
For more course tutorials visit
www.ecet370.com
General Instructions
Exercises 1, 2, and 3 use the programs in DocSharinglabeled “User-
defined linked list."
Exercise 4 uses the programs in DocSharinglabeled “Using
java.util.LinkedList."
Exercise 1: Review of Linked Lists Create a project using the classes
in the DocSharing area labeled “User-defined linked list." Compile it,
run it, and review the code that is given carefully. This code tests the
LinkedList class provided in the lecture. Extend the class Main to test
the functions isEmpty, search and remove of the class LinkedList.
Exercise 2: A User-Defined Linked List Modify the class LinkedList
given in the lecture by adding to it the functions listed below for
Exercise 2. In each case, the appropriate error message should be
generated if an invalid condition occurs. a. toString(): modify the
display function to overload the toString function of the Object class.
b. int length(): create this function to determine the number of items
in the list (accessor function). c. void clear(): create this function to
remove all of the items from the list. After this operation is
completed, the length of the list is zero. d. void insertEnd(int item):
create this function to insert item at the end of the list. e. void
replace(int location, int item): create this function to replace the item
in the list at the position specified by location. The item should be
replaced with item. f. int get(int location): create a function that
returns the element at the position location.
Exercise 3: Using a Linked List This exercise is similar to Exercise 3
in Lab 2, but uses the LinkedList class implemented in Exercise 2
above. That is, using the class LinkedList, write a program that uses it
to store 100 random numbers. Again, consider that each of these
random numbers is an integer in the interval [0, 200]. Write the
program in such a way that there are no number duplicates.
Exercise 4: Review of the Library Class java.util.LinkedList Create a
project using the class in the DocSharing area labeled “Using
java.util.LinkedList." Compile it, run it, and review the code that is
given carefully. This code is the complete program given in our
lecture that tests the library class java.util.LinkedList. Exercise 5:
Using the Library Class java.util.LinkedList Rewrite Exercise 3
(above) using the class java.util.LinkedList to store the 100 random
numbers.
================================
ECET 370 Week 4 ilab The Efficiencyof Algorithms
and Sorting (New Syllabus)
For more course tutorials visit
www.ecet370.com
ECET 370 Week 4 ilab The Efficiency of Algorithms and Sorting
iLAB OVERVIEW
Scenario and Summary
The purpose of the lab exercises is to help the student acquire skills in
developing programs that involve algorithm analysis, recursion, and
sorting.
Deliverables
There are four exercises in this lab, although not all of them will be
required for submission. Be sure to read the following instructions
carefully.
Exercise 1: No submission is required.
Note that some of the exercises require sections of code to be timed.
To learn how to time a section of your source code, please refer to the
beginning of the Projects section in Chapter 4 of our textbook.
Exercises 2 and 4 require not only software development but also
explanations about the results of the experiments that are conducted.
Create separate Word documents to provide the details required in
these exercises.
Create a folder and name it Week 4 Lab. Inside this folder, create the
subfolders Ex2, Ex3, and Ex4. Place the solution to each of the three
exercises required for submission in the corresponding subfolder.
Compress the folder Week 4 Lab using a program like WinZip, and
place the resulting zipped folder into the Dropbox.
Note that Exercises 2, 3, and 4 require software development. Place in
the corresponding folders only .java files. Do not submit the .class
files or other files or folders that are generated by the IDE.
Required Software
Eclipse
Access the software at https://lab.devry.edu .
iLAB STEPS
Exercise 1: Review of the Lecture Contents
Back to Top
Create three projects, minimum, factorial, and sorting algorithms,
using the classes in
 Minimum
 Factorial
 Sorting Algorithms
Compile them, run them, and review the code that is given carefully.
These programs test the code discussed in the lecture.
Exercise 2: Efficiency of Algorithms
Back to Top
Problem 3 in the Projects section at the end of Chapter 4 in the
textbook: Find a value of n for which Loop B is faster.
For which value(s) of n was Loop B faster? What have you observed
in running this experiment? Any conclusions? Your observations
should be entered in a separate Word document.
Note: This exercise requires timing code. You can find how to time a
section of code in Java at the beginning of the Projects section in
Chapter 4 of the textbook.
Exercise 3: Recursion
Back to Top
Problem 5 in the Exercises section at the end of Chapter 7 in the
textbook: Write a recursive method that writes a given array
backward. Consider the last element of the array first.
Exercise 4: Sorting
Back to Top
In this week’s lecture, the algorithms quicksort and bubblesort are
described. In Sorting Algorithms you can find the class ArrayList,
where these sorting algorithms are implemented. Write a program that
times both of them for various list lengths, filling the array lists with
random numbers. Use at least 10 different list lengths, and be sure to
include both small values and large values for the list lengths. Create
a table to record the times.
List
Length
Bubblesort Time
(milliseconds)
Quicksort Time
(milliseconds)
Regarding the efficiency of both sorting methods, what conclusion
can be reached from this experiment? Both the table and your
conclusions should be included in a separate Word document.
================================
ECET 370 Week 4 Lab 4 Complexity of
Computational Problems (Devry)
For more course tutorials visit
www.ecet370.com
General Instructions
Exercise 1 uses the programs in DocSharinglabeled “Minimum,"
“Factorial,” and “Sorting algorithms."
Exercise 1: Review of the Lecture Contents Create projects using the
classes in the DocSharing areas labeled “Minimum," “Factorial,” and
“Sorting algorithms." Compile them, run them, and review the code
that is given carefully. These programs test the code discussed in the
lecture.
Exercise 2: Efficiency of Algorithms Problem 2 in the Section
“Projects” at the end of Chapter 9 in the textbook: find a value of n
for which Loop B is faster.
Exercise 3: Recursion Problem 1 in the Section “Projects” at the end
of Chapter 10 in the textbook: recursive algorithm to find the square
root of a given number. Exercise 4: Sorting In this week’s lecture, the
algorithms quicksort and bubblesort are described and implemented.
In DocSharing, under the section labeled “Sorting algorithms," you
can find the class ArrayList where these sorting algorithms are
implemented. Write a Java program that times both of them for
various values of n. Create a table to record the times. Regarding the
efficiency of both sorting methods, what conclusion can be reached
from this experiment? Note: You can probably save development time
by using the program from Week 2 to generate a list of the 1000
smallest prime numbers (in random order). This list could then be
used as the input to the sorting algorithms.
================================
ECET 370 Week 5 ilab Search Techniques and
Hashing (New Syllabus)
For more course tutorials visit
www.ecet370.com
ECET 370 Week 5 ilab Search Techniques and Hashing
iLAB OVERVIEW
Scenario and Summary
The purpose of the lab exercises is to help the student acquire skills in
developing programs that involve search algorithms and techniques.
Deliverables
There are four exercises in this lab, although not all of them will be
required for submission. Be sure to read the following instructions
carefully.
Exercise 1: No submission is required.
Note that one of the exercises requires sections of code to be timed.
To review how to time a section of your source code, please refer to
the beginning of the Projects section in Chapter 4 of our textbook.
Exercise 2 requires not only software development but also
explanations about the results of the experiments that are conducted.
Create a separate Word document to provide the details required in
the exercise.
Create a folder and name it Week 5 Lab. Inside this folder, create the
subfolders Ex2, Ex3, and Ex4. Place the solution to each of the three
exercises required for submission in the corresponding subfolder.
Compress the folder Week 5 Lab, and place the resulting zipped folder
into the Dropbox.
Note that Exercises 2, 3, and 4 require software development. Place in
the corresponding folders only .java files. Do not submit the .class
files or other files or folders that are generated by the IDE.
Required Software
Eclipse
Access the software at https://lab.devry.edu .
iLAB STEPS
Exercise 1: Review of the Lecture Content
Back to Top
Create a project using the ArrayList class and the Main class in
Search Algorithms. The ArrayList class contains implementations of
the first three search methods explained in this week’s lecture:
sequential, sorted, and binary search. The Main class uses these three
methods. These programs test the code discussed in the lecture.
Compile the project, run it, and review the code that is given
carefully.
Exercise 2: Search Algorithms and Techniques
Back to Top
Expand the project developed in the previous exercise to perform the
following experiment: Time the sequential search and the binary
search methods several times each for randomly generated values, and
record the results in a table. Do not time individual searches, but
groups of them. For example, time 100 searches together or 1,000
searches together. Compare the running times of these two search
methods that are obtained during the experiment.
Regarding the efficiency of both search methods, what conclusion can
be reached from this experiment? Both the table and your conclusions
should be included in a separate Word document.
Exercise 3: Searching Applications
Back to Top
The following problem is a variation of Project 4 in the "Projects"
section of Chapter 18 in our textbook:
Consider an array data of n numerical values in sorted order and a list
of two numerical target values. Your goal is to compute the smallest
range of array indices that contains both of the target values. If a
target value is smaller than data[0], the range should start with a -1. If
a target value is larger than data[n-1], the range should end with n.
For example, given the array
012 3 4 5 6 7
58101315202226
the following table illustrates target values and their corresponding
ranges:
Target ValuesSmellest Range of Indices
2, 8 [-1, 1]
9, 14 [1, 4]
12, 21 [2, 6]
14, 30 [3, 8]
Devise and implement an algorithm that solves this problem.
Exercise 4: Hashing
Back to Top
Suppose that the type of key in a hashing application you are
implementing is string (Sections 21.7 and 21.8 in our textbook
explain hash functions for strings). Design and implement a hash
function that converts a key to a hash value. Test your function by
computing the hash values for the Java keywords. Was a key collision
produced?
================================
ECET 370 Week 5 Lab 5 Search Algorithms and
Techniques (Devry)
For more course tutorials visit
www.ecet370.com
General Instructions
Exercise 1 uses the programs in DocSharinglabeled “Search
algorithms."
Exercise 1: Review of the Lecture Content Create a project using the
ArrayList class and the Main class provided in DocSharing. The
ArrayList class contains implementations of the first three search
methods explained in this week’s lecture: sequential, sorted, and
binary search. The Main class uses these three methods. These
programs test the code discussed in the lecture. Compile the project,
run it, and review the code that is given carefully.
Exercise 2: Search Algorithms and Techniques Expand the project
developed in the previous exercise to perform the following
experiment: time the three search methods several times each and
record the results. Compare the running times of the three search
methods (sequential search, sorted search, and binary search) which
are obtained during the experiment. What conclusions can be drawn?
Exercise 3: Searching Applications Select one of the following two
problems to solve: Problem 1: Design and implement an algorithm
that determines whether or not a given array of elements, list1, is
completely contained within another given array of elements, list2.
Consider two different scenarios: 1) both arrays are sorted; 2) both
arrays are unsorted. Problem 2: Design an algorithm that when given
a collection of integers in an unsorted array, determines the second
smallest number (or second minimum). For example, if the array
consists of the values 12, 23, 9, 17, 3, the algorithm should report the
value 9, since it is the second smallest number in the array. Write a
function that receives an array as a parameter and returns the second
smallest number. To test your function, write a program that
populates an array with random numbers and then call your function.
Exercise 4: Hashing Suppose that the type of key in a hashing
application you are implementing is String (Sections 19.6 and 19.7 in
our textbook explain hash functions for strings). Design, implement,
and test a hash function that converts a key to a hash value. Assume
that the size of the hash table is a prime number.
================================
ECET 370 Week 6 ilab Binary Trees (New Syllabus)
For more course tutorials visit
www.ecet370.com
ECET 370 Week 6 ilab Binary Trees
iLAB OVERVIEW
Scenario and Summary
The purpose of the lab exercises is to help the student acquire skills in
developing programs that involve the use of binary trees. We will be
concentrating primarily on binary search trees, or BSTs.
Deliverables
There are five exercises in this lab, although not all of them will be
required for submission. Be sure to read the following instructions
carefully.
Exercise 1: No submission is required.
Create a folder and name it Week 6 Lab. Inside this folder, create the
subfolders Ex2, Ex3, Ex4, and Ex5. Place the solution to each of the
four exercises required for submission in the corresponding subfolder.
Compress the folder Week 6 Lab, and place the resulting zipped
folder into the Dropbox.
Note that Exercises 2, 3, 4, and 5 require software development. Place
in the corresponding folders only .java files. Do not submit the .class
files or other files or folders that are generated by the IDE.
Required Software
Eclipse
Access the software at https://lab.devry.edu .
iLAB STEPS
Exercise 1: Lecture Review—Binary Search Tree
Back to Top
Create a project using the classes BinarySearchTree, Node, and Main
in Binary Search Tree. Compile the project, run it, and review the
code that is given carefully. These programs test the code discussed in
our lecture.
Exercise 2: An Improved BST Class
Back to Top
Add the toString method to the class BinarySearchTree in Exercise 1.
Note: The toString method returns a string representation of the object
properties. By implementing toString, a BinarySearchTree object can
be displayed in a simple way using System.out.print or
System.out.println. For example, if bst is a BinarySearchTree object,
it can be printed using System.out.println(bst).
Exercise 3: Using a BST in an Application
Back to Top
Create a class SimpleBag that uses a binary search tree to store the
bag items.The class should have the methods listed below. Create a
Main class to test your SimpleBag class.
1. SimpleBag(): default constructor; creates an empty bag
2. booleanisEmpty(): determines whether the bag is empty
3. void print(): prints the SimpleBag elements
4. void clear(): removes all of the items from the bag
5. void add(int item): adds an item to the bag
6. int count(int item): counts the number of occurrences of items in
the bag.
Exercise 4: Recursion and Binary Trees
Back to Top
Add a recursive function getHeight to the BinarySearchTree class in
Exercise 1 that returns the height of the tree. Create a Main class to
test it.
Exercise 5: Using Properties of BSTs
Back to Top
Add methods preorderDisplay and postorderDisplay to the
BinarySearchTree class in Exercise 1 to print the items in the BST
listed in preorder and postorder, respectively. Create a Main class to
test them.
================================
ECET 370 Week 7 ilab Collections Framework(New
Syllabus)
For more course tutorials visit
www.ecet370.com
ECET 370 Week 7 ilab Collections Framework
iLAB OVERVIEW
Scenario and Summary
The purpose of the lab exercises is to help the student acquire skills in
developing programs that involve the use of the collections
framework.
Deliverables
There are five exercises in this lab, although not all of them will be
required for submission. Be sure to read the following instructions
carefully.
Exercise 1: No submission is required.
Create a folder and name it Week 7 Lab. Inside this folder, create the
subfolders Ex2, Ex3, Ex4, and Ex5. Place the solution to each of the
four exercises required for submission in the corresponding subfolder.
Compress the folder Week 7 Lab, and drop the resulting zipped folder
into the Dropbox.
Note that Exercises 2, 3, 4, and 5 require software development. Place
only source files in the corresponding folders. Do not submit other
types of files or folders that are generated by the IDE.
Exercises 2 and 4 should be implemented using the Java
programming language, and Exercises 3 and 5 should be implemented
using the C++ programming language. Exercise 1 requires both.
Required Software
Eclipse
Access the software at https://lab.devry.edu .
Microsoft Visual Studio 2012
Access the software at https://lab.devry.edu .
iLAB STEPS
Exercise 1: Lecture Review—JCF and STL
Back to Top
Create seven projects, JCF array list, JCF linked list, JCF sort,JCF
stack, STL doubly linked list, STL stack and queue, and STL vector,
using the programs in:
 JCF array list
 JCF linked list
 JCF sort
 JCF stack
 STL doubly linked list
 STL stack and queue
 STL vector
Compile the projects, run them, and review the code that is given
carefully. These programs test the code discussed in our lecture.
Exercise 2: Using the JCF ArrayList
Back to Top
Write a Java program to store 1,000 random numbers, each in the
interval [0, 500], in a java.util.ArrayList object. Print the numbers.
Exercise 3: Using the STL Vector
Back to Top
Write a C++ program to store the first 20 factorials: 1!, 2!, 3!, . . . ,
20! in a vector object.
Exercise 4: Developing an Application with JCF
Back to Top
Complete Project 2 at the end of Chapter 5 in our textbook: Write a
Java program that uses a stack to test whether an input string is a
palindrome. To implement the solution to this problem, use the stack
data structure in JCF.
Note that this exercise is a variation of Exercise 3 in the lab of Week
3.
Exercise 5: Developing an Application with C++ STL
Back to Top
Complete Project 4 at the end of Chapter 10 in our textbook:Simulate
a small airport with one runway. Airplanes waiting to take off join a
queue on the ground. Planes waiting to land join a queue in the air.
Only one plane can use the runway at any given time. All planes in
the air must land before any plane can take off. To implement the
solution to this problem, use the queue data structure in C++ STL.
Note that this exercise is a variation of Exercise 6 in the lab of Week
3.
================================
ECET 370 Week 7 Lab 7 Binary Trees (Devry)
For more course tutorials visit
www.ecet370.com
Full set of lab with working programs.
Exercise 1: Lecture review: Binary Search Tree Create a project using
the classes BinarySearchTree, Node, and Main in the DocSharing area
labeled “The BST." Compile the project, run it, and review the code
that is given carefully. These programs test the code discussed in our
lecture.
Exercise 2: An improved BST class Modify the class
BinarySearchTree so that it contains the toString method, instead of
the display method that was given originally.
Exercise 3: Using a BST in an application Use a binary search tree to
implement a dictionary that contains the keywords in the Java
language. Test it. Note that you can use the programs from the
previous exercises. For a list of the keywords in Java, visit
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.
html.
Exercise 4: Recursion and Binary Trees Write a recursive algorithm
that counts the nodes in a binary search tree.
Exercise 5: Using properties of BSTs Write an algorithm getMax to
find the maximum value stored in a binary search tree.
================================

Más contenido relacionado

La actualidad más candente

Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arraynikig6806
 
Ecet 370 Education Organization -- snaptutorial.com
Ecet 370   Education Organization -- snaptutorial.comEcet 370   Education Organization -- snaptutorial.com
Ecet 370 Education Organization -- snaptutorial.comDavisMurphyB81
 
Lewis jssap3 e_labman02
Lewis jssap3 e_labman02Lewis jssap3 e_labman02
Lewis jssap3 e_labman02auswhit
 
66781291 java-lab-manual
66781291 java-lab-manual66781291 java-lab-manual
66781291 java-lab-manualLaura Popovici
 
Java lab1 manual
Java lab1 manualJava lab1 manual
Java lab1 manualnahalomar
 
Cs2312 OOPS LAB MANUAL
Cs2312 OOPS LAB MANUALCs2312 OOPS LAB MANUAL
Cs2312 OOPS LAB MANUALPrabhu D
 
Ch01 basic-java-programs
Ch01 basic-java-programsCh01 basic-java-programs
Ch01 basic-java-programsJames Brotsos
 
Java programming lab manual
Java programming lab manualJava programming lab manual
Java programming lab manualsameer farooq
 
Devry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newDevry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newmybrands2
 
Cis 355 ilab 3 of 6
Cis 355 ilab 3 of 6Cis 355 ilab 3 of 6
Cis 355 ilab 3 of 6ashhadiqbal
 

La actualidad más candente (19)

Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
 
Ecet 370 Education Organization -- snaptutorial.com
Ecet 370   Education Organization -- snaptutorial.comEcet 370   Education Organization -- snaptutorial.com
Ecet 370 Education Organization -- snaptutorial.com
 
Ecet 370 week 2 lab 2
Ecet 370 week 2 lab 2Ecet 370 week 2 lab 2
Ecet 370 week 2 lab 2
 
Lewis jssap3 e_labman02
Lewis jssap3 e_labman02Lewis jssap3 e_labman02
Lewis jssap3 e_labman02
 
Icom4015 lecture10-f16
Icom4015 lecture10-f16Icom4015 lecture10-f16
Icom4015 lecture10-f16
 
Icom4015 lecture14-f16
Icom4015 lecture14-f16Icom4015 lecture14-f16
Icom4015 lecture14-f16
 
Java lab-manual
Java lab-manualJava lab-manual
Java lab-manual
 
66781291 java-lab-manual
66781291 java-lab-manual66781291 java-lab-manual
66781291 java-lab-manual
 
Icom4015 lecture8-f16
Icom4015 lecture8-f16Icom4015 lecture8-f16
Icom4015 lecture8-f16
 
Collections
CollectionsCollections
Collections
 
Java lab1 manual
Java lab1 manualJava lab1 manual
Java lab1 manual
 
All experiment of java
All experiment of javaAll experiment of java
All experiment of java
 
Cs2312 OOPS LAB MANUAL
Cs2312 OOPS LAB MANUALCs2312 OOPS LAB MANUAL
Cs2312 OOPS LAB MANUAL
 
Ch01 basic-java-programs
Ch01 basic-java-programsCh01 basic-java-programs
Ch01 basic-java-programs
 
CS2309 JAVA LAB MANUAL
CS2309 JAVA LAB MANUALCS2309 JAVA LAB MANUAL
CS2309 JAVA LAB MANUAL
 
Java programming lab manual
Java programming lab manualJava programming lab manual
Java programming lab manual
 
Devry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newDevry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees new
 
Simple Java Programs
Simple Java ProgramsSimple Java Programs
Simple Java Programs
 
Cis 355 ilab 3 of 6
Cis 355 ilab 3 of 6Cis 355 ilab 3 of 6
Cis 355 ilab 3 of 6
 

Similar a ECET 370 Inspiring Innovation--ecet370.com

Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arraymybrands2
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arraymailemail
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayolivergeorg
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayuopassignment
 
ECET 370 Entire Course NEW
ECET 370 Entire Course NEWECET 370 Entire Course NEW
ECET 370 Entire Course NEWshyamuopuop
 
ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com donaldzs157
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newnikig6806
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newmybrands2
 
Devry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newDevry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newmailemail
 
Devry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newDevry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newuopassignment
 
Devry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newDevry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newolivergeorg
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newmailemail
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newolivergeorg
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newuopassignment
 
Devry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newDevry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newmybrands2
 
Devry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newDevry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newnikig6806
 
Devry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newDevry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newmailemail
 
Devry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newDevry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newolivergeorg
 
Devry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newDevry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newuopassignment
 

Similar a ECET 370 Inspiring Innovation--ecet370.com (20)

Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
 
ECET 370 Entire Course NEW
ECET 370 Entire Course NEWECET 370 Entire Course NEW
ECET 370 Entire Course NEW
 
ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
 
Devry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newDevry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists new
 
Devry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newDevry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists new
 
Devry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newDevry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists new
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
 
Devry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newDevry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists new
 
Devry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists newDevry ecet 370 week 2 ilab linked lists new
Devry ecet 370 week 2 ilab linked lists new
 
Devry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newDevry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees new
 
Devry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newDevry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees new
 
Devry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees newDevry ecet 370 week 6 ilab binary trees new
Devry ecet 370 week 6 ilab binary trees new
 
Ecet 370 week 1 lab
Ecet 370 week 1 labEcet 370 week 1 lab
Ecet 370 week 1 lab
 

Último

Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 

Último (20)

Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 

ECET 370 Inspiring Innovation--ecet370.com

  • 1. ECET 370 Entire Course (Devry) For more course tutorials visit www.ecet370.com ECET 370 Week 1 Lab 1 ECET 370 Week 2 Lab 2 ECET 370 Week 3 Lab 3 Linked Lists ECET 370 Week 4 Lab 4 Complexity of Computational Problems ECET 370 Week 5 Lab 5 Search Algorithms and Techniques ECET 370 Week 7 Lab 7 Binary Trees ================================ ECET 370 Week 1 iLab Array Based Implementations (New Syllabus) For more course tutorials visit www.ecet370.com ECET 370 Week 1 iLab Array-Based Implementations iLAB OVERVIEW Scenario and Summary
  • 2. The purpose of the iLab exercises is to help the student acquire skills in developing programs that require implementation with arrays of abstract data types, such as lists and bags. Note!Software Citation Requirements This course uses open-source software which must be cited when used for any student work. Citation requirements are on theOpen Source Applications page. Please review the installation instruction files to complete your assignment Deliverables There are four exercises in this iLab, although not all of them will be required for submission. Be sure to read the following instructions carefully. Exercise 1: No submission is required. Exercise 4 contains parts a, b, c and continues through part i. Keep in mind that the methods developed for each of these parts should be within the same bag class. Create a folder and name it Week 1 iLab. Inside this folder, create the subfolders Ex2, Ex3, and Ex4. Place the solution to each of the three exercises required for submission in the corresponding subfolder. Compress the folder Week 1 iLab, and drop the resulting zipped folder into the Dropbox. Note that Exercises 2, 3, and 4 require software development. Place in the corresponding folders only .java files. Do not submit the .class files or other files or folders that are generated by the IDE. Required Software Eclipse
  • 3. Access the software at https://lab.devry.edu . iLAB STEPS Exercise 1: Review of Array-Based Lists Back to Top Create a project using the classes in this zip file and name it "A Simple ArrayList Class." Compile it, run it, and review the code that is given carefully. This code tests the ArrayList class discussed in the lecture. Exercise 2: Implementing an Array List Back to Top Modify the class ArrayList given in Exercise 1 by using expandable arrays. That is, if the list is full when an item is being added to this list, the elements will be moved to a larger array. The new array should have twice the size of the original array. Exercise 3: Using an Array-Based List Back to Top Using the class ArrayList completed in the previous exercise, write a program to store 1,000 random numbers, each in the interval [0, 500]. The initial size of the array in the class should be set to 100. Print the numbers. Exercise 4: Implementing a Bag Class Back to Top Create a class bag (multiset) that uses an expandable array to store the bag items. The item type must be a Java String type; that is, the bag will store strings of characters. The class should have the methods
  • 4. listed below. Create a main class to test your bag class. This main class should fill a bag with the keywords of the Java language. 1. Bag(): default constructor 2. booleanisEmpty(): determines whether the bag is empty 3. void print(): prints the bag elements 4. intgetLength(): returns the number of items in the bag 5. void clear(): removes all of the items from the bag 6. void add(String item): adds an item to the bag 7. voidremoveOne(String item): removes item from the bag; only one occurrence of item should be removed. 8. voidremoveAll(String item): removes item from the bag; all occurrences of item should be removed. 9. int count(String item): counts the number of occurrences of item in the bag ================================ ECET 370 Week 1 Lab 1 (Devry) For more course tutorials visit www.ecet370.com General Instructions Exercises 1, 2, 4, and 5 use the programs in DocSharinglabeled “User-defined classes."
  • 5. Exercises 7 and 8 use the programs in DocSharinglabeled “Using interfaces." Exercise 1: Review of classes Create a project using the classes in the DocSharing area labeled “User-defined classes." Compile it, run it, and review the code that is given carefully. Exercise 2: User-defined methods The function area of the Triangle class is the framework of the actual method. Modify it so that it calculates the area of the triangle. Write a Main class to test your area method. Note: to calculate the area of a triangle from the vertices, first find the distances between each pair of vertices to obtain the length of the sides of the triangle. Then apply Heron’s formula to calculate the area given the length of the sides. Exercise 3: Shallow versus deep copy Provide an example of shallow copy of objects and an example of deep copy of objects. Exercise 4: Passing parameters to methods Write a function that swaps two Point objects. Use the code given below: import java.util.*; public class Main { public Main() { Scanner Scanner(System.in); System.out. print("Enter x and y coordinates of first point: "); Point Point (in.nextDouble(), in.nextDouble()); System.out. print("Enter x and y coordinates of second point: "); Point Point (in.nextDouble(), in.nextDouble()); swap(p1, p2); System.out.println(" Compile it, run it, and review the code that is given carefully. Note: The class Point implements the Comparable interface. The Comparable interface contains a single method: compareTo, which is used to compare two objects p and q of the same class type. When calling p.compareTo(q), it returns an integer. If this value is negative it means that p is smaller; if it is equal to zero then , and if the value is positive, it indicates that p is greater than q. Exercise 8: Implementation of interfaces Using the class Point in the DocSharing area labeled “Using interfaces," write an application that
  • 6. declares an array of Points, fills the array with random points, and finds the smallest point in the array. ================================ ECET 370 Week 2 ilab Linked Lists (New Syllabus) For more course tutorials visit www.ecet370.com ECET 370 Week 2 ilab Linked Lists iLAB OVERVIEW Scenario and Summary The purpose of the iLab exercises is to help the student acquire skills in developing programs that require the implementation with linked lists of abstract data types, such as lists and bags. Deliverables There are four exercises in this iLab, although not all of them will be required for submission. Be sure to read the following instructions carefully. Exercise 1: No submission is required. Exercise 4 contains Parts a, b, c, d, e, f, g, and h. Keep in mind that the methods developed for each of these parts should be within the same bag class. Create a folder and name it Week 2 iLab. Inside this folder, create the subfolders Ex2, Ex3, and Ex4. Place the solution to each of the three exercises required for submission in the corresponding subfolder.
  • 7. Compress the folder Week 2 iLab, and drop the resulting zipped folder into the Dropbox. Note that Exercises 2, 3, and 4 require software development. Place in the corresponding folders only .java files. Do not submit the .class files or other files or folders that are generated by the IDE. Required Software Eclipse Access the software at https://lab.devry.edu . iLAB STEPS Exercise 1: Review of Linked Lists Back to Top Create a project using the classes in "A Simple LinkedList Class." Compile it, run it, and review the code that is given carefully. This code tests the LinkedList class provided in the lecture. Exercise 2: Implementing a Doubly Linked List Back to Top Modify the class LinkedList in Exercise 1 to make it a doubly linked list. Name your class DoublyLinkedList. Add a method addEnd to add an integer at the end of the list and a method displayInReverse to print the list backwards: voidaddEnd(int x): create this method to add x to the end of the list. voiddisplayInReverse(): create this method to display the list elements from the last item to the first one. Create a main class to test your DoublyLinkedList class. Exercise 3: Using a Doubly Linked List Back to Top
  • 8. Using the class DoublyLinkedList completed in the previous exercise, write a program to store all the prime numbers up to 100 in a DoublyLinkedList object. The numbers should be stored in such a way that when “display” is invoked, the listing will be shown in increasing order: 2, 3, 5, 7, 11, 13, 17, … . Exercise 4: Implementing a Bag Class Back to Top Create a class bag that uses a linked list to store the bag items. The item type must be a Java String type, that is, the bag will store strings of characters. The class should have the methods listed below. Create a main class to test your bag class. This main class should fill a bag with the keywords of the Java language. 1. . Bag(): default constructor 2. booleanisEmpty(): determines whether the bag is empty 3. void print(): prints the bag elements 4. intgetLength(): returns the number of items in the bag 5. void clear(): removes all of the items from the bag 6. void add(String item): adds an item to the bag 7. voidremoveOne(String item): removes an item from the bag; only one occurrence of the item should be removed. int count(String item): counts the number of occurrences of an item in the bag. (Note that you can reuse the code in Exercise 1 for the LinkedList class to create your bag class. It will help you to save development time.) ================================
  • 9. ECET 370 Week 2 Lab 2 (Devry) For more course tutorials visit www.ecet370.com General Instructions Exercises 1, 2, and 3 use the programs in DocSharinglabeled “User- defined array list." Exercise 4 uses the programs in DocSharinglabeled “Using java.util.ArrayList." Exercise 1: Review of array-based lists Create a project using the classes in the DocSharing area labeled “User-defined array list." Compile it, run it, and review the code that is given carefully. This code tests the ArrayList class provided in the lecture. Exercise 2: A user-defined array list Modify the class ArrayList given in the lecture by adding to it the functions listed below for Exercise 2. In each case, the appropriate error message should be generated if an invalid condition occurs. For example, an error message should be generated when trying to insert an item in a given location in the list and the location is out of range. a. ArrayList(int size): create a constructor that sets the size of the array list to the value passed in size (note that the class variable SIZE cannot be final anymore). b. int length(): create this function to determine the number of items in the list (accessor function). c. intgetSize(): create this function to determine the size of the list (accessor function). d. void clear(): create this function to remove all of the items from the list. After this operation, the length of the list is zero. e. void replace(int location, int item): create this function to replace the item in the list at the position
  • 10. specified by location. The item should be replaced with item. f. void insert(int location, int item): create this function to add an item to the list at the position specified by location. g. void remove(int item): create this function to delete an item from the list. All occurrences of item in the list should be removed. h. int get(int location): create a function that returns the element at location. i. public ArrayList copy(): create a function that makes a deep copy to another ArrayList object. Exercise 3: Using an array-based list Using the class ArrayList completed in the previous exercise, write a program that uses it to store 100 random numbers. Consider that each of these random numbers is an integer in the interval [0, 200]. Write the program in such a way that there are no number duplicates. Exercise 4: Review of the library class java.util.ArrayList Create a project using the classes in the DocSharing area labeled “Using java.util.ArrayList." Compile it, run it, and review the code that is given carefully. This code is the complete program given in our lecture that tests the library class java.util.ArrayList. Exercise 5: Using the library class java.util.ArrayList Rewrite Exercise 3 (above) using the class java.util.ArrayList to store the 100 random numbers. ================================ ECET 370 Week 3 ilab The Stack and the Queue ADTs (New Syllabus) For more course tutorials visit www.ecet370.com
  • 11. ECET 370 Week 3 ilab The Stack and the Queue ADTs iLAB OVERVIEW Scenario and Summary The purpose of the iLab exercises is to help the student acquire skills in developing programs that involve the use of the stack and the queue data structures. Deliverables There are six exercises in this iLab, although not all of them will be required for submission. Be sure to read the following instructions carefully. Exercises 1 and 4: No submissions are required. Create a folder and name it Week 3 iLab. Inside this folder, create the subfolders Ex2, Ex3, Ex5, and Ex6. Place the solution to each of the four exercises required for submission in the corresponding subfolder. Compress the folder Week 3 iLab using a program like WinZip, and drop the resulting zipped folder into the Dropbox. Note that Exercises 2, 3, 5, and 6 require software development. Place only .java files in the corresponding folders. Do not submit the .class files or other files or folders that are generated by the IDE. Required Software Eclipse Access the software at https://lab.devry.edu . iLAB STEPS Exercise 1: Review of the Stack ADT Back to Top
  • 12. Create a project using the classes in "A Simple Stack Class". Compile the project, run it, and review the code that is given carefully. This code tests the stack class provided in the lecture. Exercise 2: An Improved Stack Class Back to Top Modify the stack class to include appropriate error messages if invalid conditions occur—for example, trying to pop an item when the stack is empty. Exercise 3: Using a Stack in an Application Back to Top Complete Project 2 at the end of Chapter 5 in our textbook: Write a Java program that uses a stack to test whether an input string is a palindrome. Exercise 11 defines "palindrome" and asks you to describe a solution to this problem. As you can see, you will need to read Exercise 11 to find the meaning of palindrome. To implement the solution to this problem, use the stack of characters from the previous exercises (1 and 2). Exercise 4: Review of the Queue ADT Back to Top Create a project using the classes in "A Simple Queue Class." Compile the project, run it, and review the code that is given carefully. This code tests the queue class provided in the lecture. Exercise 5: An Improved Queue Class Back to Top
  • 13. Modify the class queue to include appropriate error messages if invalid conditions occur—for example, trying to dequeue an item when the queue is empty. Exercise 6: Using a Queue in an Application Back to Top Complete Project 4 at the end of Chapter 10 in our textbook:Simulate a small airport with one runway. Airplanes waiting to take off join a queue on the ground. Planes waiting to land join a queue in the air. Only one plane can use the runway at any given time. All planes in the air must land before any plane can take off. ================================ ECET 370 Week 3 Lab 3 Linked Lists (Devry) For more course tutorials visit www.ecet370.com General Instructions Exercises 1, 2, and 3 use the programs in DocSharinglabeled “User- defined linked list." Exercise 4 uses the programs in DocSharinglabeled “Using java.util.LinkedList." Exercise 1: Review of Linked Lists Create a project using the classes in the DocSharing area labeled “User-defined linked list." Compile it, run it, and review the code that is given carefully. This code tests the LinkedList class provided in the lecture. Extend the class Main to test the functions isEmpty, search and remove of the class LinkedList.
  • 14. Exercise 2: A User-Defined Linked List Modify the class LinkedList given in the lecture by adding to it the functions listed below for Exercise 2. In each case, the appropriate error message should be generated if an invalid condition occurs. a. toString(): modify the display function to overload the toString function of the Object class. b. int length(): create this function to determine the number of items in the list (accessor function). c. void clear(): create this function to remove all of the items from the list. After this operation is completed, the length of the list is zero. d. void insertEnd(int item): create this function to insert item at the end of the list. e. void replace(int location, int item): create this function to replace the item in the list at the position specified by location. The item should be replaced with item. f. int get(int location): create a function that returns the element at the position location. Exercise 3: Using a Linked List This exercise is similar to Exercise 3 in Lab 2, but uses the LinkedList class implemented in Exercise 2 above. That is, using the class LinkedList, write a program that uses it to store 100 random numbers. Again, consider that each of these random numbers is an integer in the interval [0, 200]. Write the program in such a way that there are no number duplicates. Exercise 4: Review of the Library Class java.util.LinkedList Create a project using the class in the DocSharing area labeled “Using java.util.LinkedList." Compile it, run it, and review the code that is given carefully. This code is the complete program given in our lecture that tests the library class java.util.LinkedList. Exercise 5: Using the Library Class java.util.LinkedList Rewrite Exercise 3 (above) using the class java.util.LinkedList to store the 100 random numbers. ================================
  • 15. ECET 370 Week 4 ilab The Efficiencyof Algorithms and Sorting (New Syllabus) For more course tutorials visit www.ecet370.com ECET 370 Week 4 ilab The Efficiency of Algorithms and Sorting iLAB OVERVIEW Scenario and Summary The purpose of the lab exercises is to help the student acquire skills in developing programs that involve algorithm analysis, recursion, and sorting. Deliverables There are four exercises in this lab, although not all of them will be required for submission. Be sure to read the following instructions carefully. Exercise 1: No submission is required. Note that some of the exercises require sections of code to be timed. To learn how to time a section of your source code, please refer to the beginning of the Projects section in Chapter 4 of our textbook. Exercises 2 and 4 require not only software development but also explanations about the results of the experiments that are conducted. Create separate Word documents to provide the details required in these exercises. Create a folder and name it Week 4 Lab. Inside this folder, create the subfolders Ex2, Ex3, and Ex4. Place the solution to each of the three
  • 16. exercises required for submission in the corresponding subfolder. Compress the folder Week 4 Lab using a program like WinZip, and place the resulting zipped folder into the Dropbox. Note that Exercises 2, 3, and 4 require software development. Place in the corresponding folders only .java files. Do not submit the .class files or other files or folders that are generated by the IDE. Required Software Eclipse Access the software at https://lab.devry.edu . iLAB STEPS Exercise 1: Review of the Lecture Contents Back to Top Create three projects, minimum, factorial, and sorting algorithms, using the classes in  Minimum  Factorial  Sorting Algorithms Compile them, run them, and review the code that is given carefully. These programs test the code discussed in the lecture. Exercise 2: Efficiency of Algorithms Back to Top Problem 3 in the Projects section at the end of Chapter 4 in the textbook: Find a value of n for which Loop B is faster.
  • 17. For which value(s) of n was Loop B faster? What have you observed in running this experiment? Any conclusions? Your observations should be entered in a separate Word document. Note: This exercise requires timing code. You can find how to time a section of code in Java at the beginning of the Projects section in Chapter 4 of the textbook. Exercise 3: Recursion Back to Top Problem 5 in the Exercises section at the end of Chapter 7 in the textbook: Write a recursive method that writes a given array backward. Consider the last element of the array first. Exercise 4: Sorting Back to Top In this week’s lecture, the algorithms quicksort and bubblesort are described. In Sorting Algorithms you can find the class ArrayList, where these sorting algorithms are implemented. Write a program that times both of them for various list lengths, filling the array lists with random numbers. Use at least 10 different list lengths, and be sure to include both small values and large values for the list lengths. Create a table to record the times. List Length Bubblesort Time (milliseconds) Quicksort Time (milliseconds) Regarding the efficiency of both sorting methods, what conclusion can be reached from this experiment? Both the table and your conclusions should be included in a separate Word document. ================================
  • 18. ECET 370 Week 4 Lab 4 Complexity of Computational Problems (Devry) For more course tutorials visit www.ecet370.com General Instructions Exercise 1 uses the programs in DocSharinglabeled “Minimum," “Factorial,” and “Sorting algorithms." Exercise 1: Review of the Lecture Contents Create projects using the classes in the DocSharing areas labeled “Minimum," “Factorial,” and “Sorting algorithms." Compile them, run them, and review the code that is given carefully. These programs test the code discussed in the lecture. Exercise 2: Efficiency of Algorithms Problem 2 in the Section “Projects” at the end of Chapter 9 in the textbook: find a value of n for which Loop B is faster. Exercise 3: Recursion Problem 1 in the Section “Projects” at the end of Chapter 10 in the textbook: recursive algorithm to find the square root of a given number. Exercise 4: Sorting In this week’s lecture, the algorithms quicksort and bubblesort are described and implemented. In DocSharing, under the section labeled “Sorting algorithms," you can find the class ArrayList where these sorting algorithms are implemented. Write a Java program that times both of them for various values of n. Create a table to record the times. Regarding the efficiency of both sorting methods, what conclusion can be reached from this experiment? Note: You can probably save development time by using the program from Week 2 to generate a list of the 1000
  • 19. smallest prime numbers (in random order). This list could then be used as the input to the sorting algorithms. ================================ ECET 370 Week 5 ilab Search Techniques and Hashing (New Syllabus) For more course tutorials visit www.ecet370.com ECET 370 Week 5 ilab Search Techniques and Hashing iLAB OVERVIEW Scenario and Summary The purpose of the lab exercises is to help the student acquire skills in developing programs that involve search algorithms and techniques. Deliverables There are four exercises in this lab, although not all of them will be required for submission. Be sure to read the following instructions carefully. Exercise 1: No submission is required. Note that one of the exercises requires sections of code to be timed. To review how to time a section of your source code, please refer to the beginning of the Projects section in Chapter 4 of our textbook. Exercise 2 requires not only software development but also explanations about the results of the experiments that are conducted.
  • 20. Create a separate Word document to provide the details required in the exercise. Create a folder and name it Week 5 Lab. Inside this folder, create the subfolders Ex2, Ex3, and Ex4. Place the solution to each of the three exercises required for submission in the corresponding subfolder. Compress the folder Week 5 Lab, and place the resulting zipped folder into the Dropbox. Note that Exercises 2, 3, and 4 require software development. Place in the corresponding folders only .java files. Do not submit the .class files or other files or folders that are generated by the IDE. Required Software Eclipse Access the software at https://lab.devry.edu . iLAB STEPS Exercise 1: Review of the Lecture Content Back to Top Create a project using the ArrayList class and the Main class in Search Algorithms. The ArrayList class contains implementations of the first three search methods explained in this week’s lecture: sequential, sorted, and binary search. The Main class uses these three methods. These programs test the code discussed in the lecture. Compile the project, run it, and review the code that is given carefully. Exercise 2: Search Algorithms and Techniques Back to Top Expand the project developed in the previous exercise to perform the following experiment: Time the sequential search and the binary
  • 21. search methods several times each for randomly generated values, and record the results in a table. Do not time individual searches, but groups of them. For example, time 100 searches together or 1,000 searches together. Compare the running times of these two search methods that are obtained during the experiment. Regarding the efficiency of both search methods, what conclusion can be reached from this experiment? Both the table and your conclusions should be included in a separate Word document. Exercise 3: Searching Applications Back to Top The following problem is a variation of Project 4 in the "Projects" section of Chapter 18 in our textbook: Consider an array data of n numerical values in sorted order and a list of two numerical target values. Your goal is to compute the smallest range of array indices that contains both of the target values. If a target value is smaller than data[0], the range should start with a -1. If a target value is larger than data[n-1], the range should end with n. For example, given the array 012 3 4 5 6 7 58101315202226 the following table illustrates target values and their corresponding ranges: Target ValuesSmellest Range of Indices 2, 8 [-1, 1] 9, 14 [1, 4] 12, 21 [2, 6]
  • 22. 14, 30 [3, 8] Devise and implement an algorithm that solves this problem. Exercise 4: Hashing Back to Top Suppose that the type of key in a hashing application you are implementing is string (Sections 21.7 and 21.8 in our textbook explain hash functions for strings). Design and implement a hash function that converts a key to a hash value. Test your function by computing the hash values for the Java keywords. Was a key collision produced? ================================ ECET 370 Week 5 Lab 5 Search Algorithms and Techniques (Devry) For more course tutorials visit www.ecet370.com General Instructions Exercise 1 uses the programs in DocSharinglabeled “Search algorithms." Exercise 1: Review of the Lecture Content Create a project using the ArrayList class and the Main class provided in DocSharing. The ArrayList class contains implementations of the first three search methods explained in this week’s lecture: sequential, sorted, and binary search. The Main class uses these three methods. These
  • 23. programs test the code discussed in the lecture. Compile the project, run it, and review the code that is given carefully. Exercise 2: Search Algorithms and Techniques Expand the project developed in the previous exercise to perform the following experiment: time the three search methods several times each and record the results. Compare the running times of the three search methods (sequential search, sorted search, and binary search) which are obtained during the experiment. What conclusions can be drawn? Exercise 3: Searching Applications Select one of the following two problems to solve: Problem 1: Design and implement an algorithm that determines whether or not a given array of elements, list1, is completely contained within another given array of elements, list2. Consider two different scenarios: 1) both arrays are sorted; 2) both arrays are unsorted. Problem 2: Design an algorithm that when given a collection of integers in an unsorted array, determines the second smallest number (or second minimum). For example, if the array consists of the values 12, 23, 9, 17, 3, the algorithm should report the value 9, since it is the second smallest number in the array. Write a function that receives an array as a parameter and returns the second smallest number. To test your function, write a program that populates an array with random numbers and then call your function. Exercise 4: Hashing Suppose that the type of key in a hashing application you are implementing is String (Sections 19.6 and 19.7 in our textbook explain hash functions for strings). Design, implement, and test a hash function that converts a key to a hash value. Assume that the size of the hash table is a prime number. ================================ ECET 370 Week 6 ilab Binary Trees (New Syllabus)
  • 24. For more course tutorials visit www.ecet370.com ECET 370 Week 6 ilab Binary Trees iLAB OVERVIEW Scenario and Summary The purpose of the lab exercises is to help the student acquire skills in developing programs that involve the use of binary trees. We will be concentrating primarily on binary search trees, or BSTs. Deliverables There are five exercises in this lab, although not all of them will be required for submission. Be sure to read the following instructions carefully. Exercise 1: No submission is required. Create a folder and name it Week 6 Lab. Inside this folder, create the subfolders Ex2, Ex3, Ex4, and Ex5. Place the solution to each of the four exercises required for submission in the corresponding subfolder. Compress the folder Week 6 Lab, and place the resulting zipped folder into the Dropbox. Note that Exercises 2, 3, 4, and 5 require software development. Place in the corresponding folders only .java files. Do not submit the .class files or other files or folders that are generated by the IDE. Required Software Eclipse Access the software at https://lab.devry.edu .
  • 25. iLAB STEPS Exercise 1: Lecture Review—Binary Search Tree Back to Top Create a project using the classes BinarySearchTree, Node, and Main in Binary Search Tree. Compile the project, run it, and review the code that is given carefully. These programs test the code discussed in our lecture. Exercise 2: An Improved BST Class Back to Top Add the toString method to the class BinarySearchTree in Exercise 1. Note: The toString method returns a string representation of the object properties. By implementing toString, a BinarySearchTree object can be displayed in a simple way using System.out.print or System.out.println. For example, if bst is a BinarySearchTree object, it can be printed using System.out.println(bst). Exercise 3: Using a BST in an Application Back to Top Create a class SimpleBag that uses a binary search tree to store the bag items.The class should have the methods listed below. Create a Main class to test your SimpleBag class. 1. SimpleBag(): default constructor; creates an empty bag 2. booleanisEmpty(): determines whether the bag is empty 3. void print(): prints the SimpleBag elements 4. void clear(): removes all of the items from the bag 5. void add(int item): adds an item to the bag
  • 26. 6. int count(int item): counts the number of occurrences of items in the bag. Exercise 4: Recursion and Binary Trees Back to Top Add a recursive function getHeight to the BinarySearchTree class in Exercise 1 that returns the height of the tree. Create a Main class to test it. Exercise 5: Using Properties of BSTs Back to Top Add methods preorderDisplay and postorderDisplay to the BinarySearchTree class in Exercise 1 to print the items in the BST listed in preorder and postorder, respectively. Create a Main class to test them. ================================ ECET 370 Week 7 ilab Collections Framework(New Syllabus) For more course tutorials visit www.ecet370.com ECET 370 Week 7 ilab Collections Framework iLAB OVERVIEW Scenario and Summary
  • 27. The purpose of the lab exercises is to help the student acquire skills in developing programs that involve the use of the collections framework. Deliverables There are five exercises in this lab, although not all of them will be required for submission. Be sure to read the following instructions carefully. Exercise 1: No submission is required. Create a folder and name it Week 7 Lab. Inside this folder, create the subfolders Ex2, Ex3, Ex4, and Ex5. Place the solution to each of the four exercises required for submission in the corresponding subfolder. Compress the folder Week 7 Lab, and drop the resulting zipped folder into the Dropbox. Note that Exercises 2, 3, 4, and 5 require software development. Place only source files in the corresponding folders. Do not submit other types of files or folders that are generated by the IDE. Exercises 2 and 4 should be implemented using the Java programming language, and Exercises 3 and 5 should be implemented using the C++ programming language. Exercise 1 requires both. Required Software Eclipse Access the software at https://lab.devry.edu . Microsoft Visual Studio 2012 Access the software at https://lab.devry.edu . iLAB STEPS Exercise 1: Lecture Review—JCF and STL
  • 28. Back to Top Create seven projects, JCF array list, JCF linked list, JCF sort,JCF stack, STL doubly linked list, STL stack and queue, and STL vector, using the programs in:  JCF array list  JCF linked list  JCF sort  JCF stack  STL doubly linked list  STL stack and queue  STL vector Compile the projects, run them, and review the code that is given carefully. These programs test the code discussed in our lecture. Exercise 2: Using the JCF ArrayList Back to Top Write a Java program to store 1,000 random numbers, each in the interval [0, 500], in a java.util.ArrayList object. Print the numbers. Exercise 3: Using the STL Vector Back to Top Write a C++ program to store the first 20 factorials: 1!, 2!, 3!, . . . , 20! in a vector object. Exercise 4: Developing an Application with JCF Back to Top
  • 29. Complete Project 2 at the end of Chapter 5 in our textbook: Write a Java program that uses a stack to test whether an input string is a palindrome. To implement the solution to this problem, use the stack data structure in JCF. Note that this exercise is a variation of Exercise 3 in the lab of Week 3. Exercise 5: Developing an Application with C++ STL Back to Top Complete Project 4 at the end of Chapter 10 in our textbook:Simulate a small airport with one runway. Airplanes waiting to take off join a queue on the ground. Planes waiting to land join a queue in the air. Only one plane can use the runway at any given time. All planes in the air must land before any plane can take off. To implement the solution to this problem, use the queue data structure in C++ STL. Note that this exercise is a variation of Exercise 6 in the lab of Week 3. ================================ ECET 370 Week 7 Lab 7 Binary Trees (Devry) For more course tutorials visit www.ecet370.com Full set of lab with working programs. Exercise 1: Lecture review: Binary Search Tree Create a project using the classes BinarySearchTree, Node, and Main in the DocSharing area labeled “The BST." Compile the project, run it, and review the code
  • 30. that is given carefully. These programs test the code discussed in our lecture. Exercise 2: An improved BST class Modify the class BinarySearchTree so that it contains the toString method, instead of the display method that was given originally. Exercise 3: Using a BST in an application Use a binary search tree to implement a dictionary that contains the keywords in the Java language. Test it. Note that you can use the programs from the previous exercises. For a list of the keywords in Java, visit http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords. html. Exercise 4: Recursion and Binary Trees Write a recursive algorithm that counts the nodes in a binary search tree. Exercise 5: Using properties of BSTs Write an algorithm getMax to find the maximum value stored in a binary search tree. ================================