providing accessible,easy to understand

ECET 370 Entire Course (Devry)

For more course tutorials visit

ECET 370 Week 1 Labs 1

ECET 370 Week 2 Labs 2

ECET 370 Week 3 Lab 3 Linked Lists

ECET 370 Week 4 Lab 4 Complexities of Computational Problems

ECET 370 Week 5 Lab 5 Search Algorithms and Techniques

ECET 370 Week 7 Lab 7 Binary Trees


ECET 370 Week 3 Lab 3 Linked Lists (Devry)

For more course tutorials visit

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 Linked List class provided in the lecture. Extend the class Main to test the functions is Empty, search and remove of the class Linked List.

Exercise 2: A User-Defined Linked List Modify the class Linked List 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. to String(): modify the display function to overload the to String function of the Object class. b. int length(): create this function to determine the number of items in the list (access or 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 5 Lab 5 Search Algorithms and Techniques (Devry)

For more course tutorials visit

General Instructions

Exercise 1 uses the programs in DocSharing labeled “Search algorithms."

Exercise 1: Review of the Lecture Content Create a project using the Array List class and the Main class provided in DocSharing. The Array List 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.