Defined asa collection of distinct elements

Assignment Help Data Structure & Algorithms
Reference no: EM131171474

DATA STRUCTURES AND ALGORITHMS

PROJECT TASKS

1. TASK1: SORTING BENCHMARKING -

In this task we want to benchmark different sorting algorithms against Microsoft Array.Sort Method. The objective of this experiment is to assess the performance (execution time) of different algorithms on different datasets. You are provided with four input datasets - 1H.txt, 1T.txt, 100T.txt, 1M.txt (please make sure to download Task1 provided files). We have selected the following sorting algorithms to use in this experiment - Insertion Sort, Selection Sort, Merge Sort, and Quick Sort.

The intended experiment scenario is as follows:

1. Run the five sorting algorithms (insertion, selection, merge and quick + Array.Sort) on the four input datasets.

2. Measure/record execution time and memory usage of these algorithms on the input un-sorted datasets.

3. Save the output, sorted dataset to S_1H.txt, S_1T.txt, S_100T.txt, S_1M.txt

4. Re-run the same algorithms on the four new datasets (sorted), from the last step.

5. Measure/record execution time and memory usage in the second experiment on the sorted datasets.

6. Plot outcomes/measurements from step 2 and step 5 using Excel (x-axis is for different input dataset size - 100, 1000,... - and y-axis is time in seconds or space in Kilobytes). You should have four plots: two (time and memory) on the unsorted data sets, and the other two (time and memory) on the sorted datasets.

Copy your plots & measurements table to word, explain your findings from both (unsorted & sorted) experiments - what does the running time of these algorithms tell you regarding best and worst case running time, and what did you find. Can you comment on the memory usage?

HOW TO APPROACH TASK1?

Please use the same project template provided in this unit to complete your assignment.

In the DataStructures_Algorithms project, add a folder called "Project01".

- Create a folder "Task01"

- Add an Enum called SortingAlgorithm [INSERTION, SELECTION, MERGE, QUICK, MICROSOFTSORT] - in "Task01" folder

- Add ISorter interface (ISorter.CS) that has one method: public void Sort(Enum SortingAlgorithm)

- Copy Vector class into "Task01" folder

- Modify Vector class to implement the ISorter interface - which means you need to implement the sort method above.

- Add any necessary methods to do different sorting algorithms - I mean add methods to sort Vector data using merge, selection,...

In the Runner project, add a file called RunnerProject01Task01

- Pass two command line arguments (right click on project, display properties, select debug properties, and specify the following): (i) filename and (ii) Sorting Algorithm name  as inputs.

- Your Runner class should read data from the input file - argument 1, create a vector object from the input file, and then call the Sort method using specified Algorithm name - argument 2

- Finally write your sorted data to a file called S_InputFilename - e.g. S_1H.txt, and your execution time & memory to AlgorithmName_Filename_Stats file - e.g. SELECTION_1H.txt.

2. TASK 2: SET THEORY CALCULATOR -

In mathematics, a set is defined asa collection of distinct (no duplication) elements . These elements could be anything - numbers, characters, strings, etc.There is no particular order of the elements in a set - e.g. set S1 = {1, 2, 3} is equivalent to set S2 = {2, 1, 3}. Set theory is the branch of mathematics that studies sets, and it has many applications in real life.  Some of these applications include: relational databases - e.g. MS SQLSERVER, MySQL, etc.; computer graphics; basis of relations and functions; graph data structure; and many more.

In the set theory, we can apply a set of key operations including: membership, subset/superset, union, intersection, difference, complementation, Cartesian product, and power set. Below we quickly explain the key set operations:

1. Membership. An element e belongs to a set A, if it is a member of A

2. Subset. A is a subset of a set A, written A ⊂ B or B ⊃ A, if every element of A belongs to B.

3. Superset. A is a superset of another set B, if all elements in B belongs to A.

4. Powerset. P is a power set of A, if P is the set of all subsets of A

5. Intersection. A ∩ B of two sets A, B is the set of all elements that belong to both A and B

6. Union. A ∪ B of two sets A, B is the set of all elements that belong to A or B

7. Set Difference. A - B of two sets B and A is the set of elements of B that do not belong to A.

8. Symmetric Difference. of two sets A and B. Is the set of elements in A or B, but not in both (not in the intersection) - elements in A only or B only but not in A ∩ B.

9. Complement. of a set A is the set difference (see number 7) between U (universal set is the set of all possible elements) and set A - elements in U, but not in A.

10. Cartesian Product. A *B is the set of all pairs (a,b) where a belongs to A, and b belongs to B.

Task specification

We want to implement a generic collection class, SetClass, that represents a set of elements, and implement the set operations explained above. The SetClass should implement the above 10 set operations as follows:

SetClass<T>

Data:

Add necessary data

Methods:

+ Membership(T element): bool

+ IsSubsetOf(SetClass<T> B): bool

+ IsSupersetOf(SetClass<T> B): bool

+ Powerset(): SetClass<SetClass<T>>

+ IntersectionWith(SetClass<T> B): SetClass<T>

+ UnionWith(SetClass<T> B): SetClass<T>

+ Difference(SetClass<T> B): SetClass<T>

+ SymmetricDifference(SetClass<T> B): SetClass<T>

+ Complement(SetClass<T> U): SetClass<T>

+ CartesianProduct<T2>(SetClass<T2> B): SetClass<Tuple<T, T2>>

+ Add any necessary methods and/or properties

* Note: The Cartesian product method can be applied on sets of different types. This is why we define the CartesianProduct as a generic method.

HOW TO APPROACH TASK2?

Please use the same project template provided in this unit to complete your assignment.

In the DataStructures_Algorithms project, add a folder called "Project01".

- Create a folder "Task02"

- Add an Enum called SetOperation [MEMBERSHIP, SUBSET, SUPERSET, ..., CARTESIANPRODUCT] - in "Task02" folder

- Create SetClass class into "Task02" folder

- Implement the 10 operations specified above.

In the Runner project, add a file called RunnerProject01Task02

- Pass three command line arguments (right click on project, display properties, select debug properties, and specify the following): (i) operation_name, (ii) file_set_A, and (iii) file_set_B_or_U_or_Element [the third argument is the name of the file of another set - B, the universal set - U, or an element  - e]

- Your Runner class should read data of set A from the input file - argument 2, read data of set B (or the universal set U, or any element) from the input file - argument 3 (if any), and use operation name as specified in argument 1.

- Finally, your runner should write the result back to Project01Task02_OperationName_Result.txt - e.g. Project01Task02_Membership_Results.txt.

Attachment:- Assignment.rar

Reference no: EM131171474

Questions Cloud

Principles of information systems security : For this exercise, you are going to start with this site: http://botlab.org. BotLab is a platform at the University of Washington that continually monitors and analyzes the behavior of spam-oriented botnets.
What happened to mussolinis alliance with hitler : When it became clear that Hitler was headed down the wrong road, Mussolini tried to change his colors again and support the Allies.- What happened to Mussolini's alliance with Hitler at that point?
Determine the resultant of the force system : Determine the resultant of the force system shown in below using graphical method - Determine the tension in the rope, assuming the pulleys to be frictionless, and the reaction at A.
Describe the biological correlates of sexual orientation : Most researchers in the area of human sexuality believe that human sexual orientation is largely biologically determined and not a matter of choice. Describe the biological (anatomical, physiological, genetic, chemical) correlates of sexual orient..
Defined asa collection of distinct elements : SIT221 -DATA STRUCTURES AND ALGORITHMS. In mathematics, a set is defined asa collection of distinct (no duplication) elements . These elements could be anything - numbers, characters, strings, etc.There is no particular order of the elements in a ..
Develop logic and compute cyclomatic complexity : Consider a program that reads a set of Data for ‘n' no. of triangles. The program reads three integer values as representing the sides of triangles. The program prints for each triangle whether the triangle is isosceles or equilateral or a simple...
Write an essay reviewing the status of women : Write an essay reviewing the status of women at California State University Northridge (CSUN) undergraduates, graduates, faculty or staff.
Discuss the role that you believe the person attractivenes : Explain the role that culture plays in the formation and maintenance of relationships. Support your response with at least one (1) example of the influence culture has on relationships.
Calculate the work output and the heat supplied : Calculate the work output and the heat supplied per kilogram of steam for the plant, assuming ideal process° and neglecting the reed pump term. Calculate also the specific steam consumption and the cycle efficiency.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Which business functions be impacted by your action plan

Identify leadership strategies you plan to implement throughout the execution of your action plan. In particular, explain which strategies you would implement to foster team collaboration among the multiple stakeholders who must collaborate to suc..

  Create a node structure

Create a Node structure. Initialize the number variable to -1 and the nextNode pointer to nullptr - Add the even numbers between 0 and 40 to the list. Your list will therefore have 20 numbers in it at that point.

  Design a representation of display screen

Create a form that lists possible potatoes and toppings in a manner that is easy for counter servers and kitchen crew to scan, and can also be used as input for the inventory reorder system.

  Terminate the linked list properly

Define a struct which has exactly 5 variables that, for one person, will hold the last name, the "other" names. the-year-took-office. the-yew-left-office, and a pointer. The pointer will be used to point to the next set of data. for the next perso..

  Program development cycle for algorithm using pseudocode

Illustrate all your work. Use modular approach to solving this problem. Give the following submodule. Calculations - module to compute gross pay. Using the Program Development Cycle, develop an algorithm using pseudocode for the following task.

  Mst (minimum spanning tree)

A graph has distinct edge weights. Does its lightest edge have to belong to the MST (Minimum Spanning Tree)? Can its heaviest edge belong to the MST?

  Java program to make choice for a coffee cup size

Create an application that prompts the user to make a choice for a Coffee cup size, S for Small, T for Tall, G for Grande and V for Venti the rates of cup sizes will be stored in a parallel double array as $2, $2.50, $3.25, and $4.50 respectively.

  Using java, design and implement an api euclidean graph

Using Java, design and implement an API EuclideanGraph for graphs whose vertices are points in the plane that include coordinates.

  Compute a shortest-path

Compute a shortest-path from u to v (instead of from u to all the nodes). One way to speed up Dijkstra's algorithm might be to run the algorithm u and from v at the same time.

  Object identifier tree

Assume you worked for a United States based corporation that wanted to develop its own MIB for managing a product line. Where in the object identifier tree would it be registered?

  Calculate bits number output of first round-des decryption

Calculate the bits number 1, 16, 33, and 48 at output of first round of DES decryption, suppose that ciphertext block is composed of all ones

  Find an optimal hamilton circuit stating at vertex c

find an optimal Hamilton Circuit stating at Vertex C

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd