Page 1 of 1

Problem statement: The objective of this project is to represent a series of numeric type (both integer and double) data

Posted: Fri May 20, 2022 3:30 pm
by answerhappygod
Problem Statement The Objective Of This Project Is To Represent A Series Of Numeric Type Both Integer And Double Data 1
Problem Statement The Objective Of This Project Is To Represent A Series Of Numeric Type Both Integer And Double Data 1 (95.02 KiB) Viewed 30 times
Problem statement: The objective of this project is to represent a series of numeric type (both integer and double) data (is called "data object" from now on) that offers (1) access to few statistics (mentioned below) according to below properties: 1. typical data object has a lot of duplicate entries 2. there is no limit to the number of unique data elements inside 3. data object supports simple statistics such as meane, standard deviation 2, min and max 4. fastest possible access to above statistics is paramount; (1) access 5. so above statistics also represent a part of the state of the data object 6. both fast access and saving space is paramount, developer must strive to use the smallest space possible for storage and must give (1) access to above statistics when demanded 7. In addition to above mentioned states, your data structure must support below operations: 1. Update operations: not frequent compared to frequent demands of statistics. Therefore, okey if they are expensive operations like O(n): 1. append: append new data. Update exist number of duplication or append from the end if new 2. removem: remove m number of a given data element only if m is less than or equal to current amount of repetitions, n 3. empty: delete all data 4. feed append from from any standard C++ container (any that supports iteration) data type (std::array, std::vector, std::set, etc)). This may be bit hard. Search about this and really have a meaningful discussion within the team. Only one feed method is allowed: this means no overloaded feed methods 2. search (fastest possible among the choices what we have discussed in the class). must return the location of the first occurrence and repetition. For example, if the first occurrence of the search data value, 20 is 3 and there are 10 of 20s, then you must return 3 and 10 as the search result of 20 3. array index operator, Il: access each unique element through an index: overload the array index operator (I) so that the ith data element in an instance of your data object, db can be accessed like db 4. length_unique: number of unique elements in your data object 5. length_total: total number of elements in your data object 6. unique_set: return all the unique elements as an std::set 7. getters (all must be (1)) and in floating point type: 1. get_mean: returns the mean value of the current entire data set 2. get_SD: returns the standard deviation of the current entire data set 3. get_min: returns the minimum data item in the current entire data set 4. get_max: returns the maximum data item in the current entire data set

Below are requirements and restrictions: 1. The principle data structure must be the most qualified linear structure we discussed so far in the class. So in the implementation you must use the code provided in Canvas 2. Updates (append, feed, removem) to the data object is possible though rare. However, the demands for above statistics is very frequent (You now understand why we need (1) 3. Though you must try to save space, your most important task is to give (1) access to above statistics, we are sacrificing the space for speed. In regard of this you are allowed to use other data structures and algorithms provided in the standard C++. You are not allowed to use any third party or external libraries (like boost) 4. Calculation of above statistics must be private internal operations. This means you have to calculate and update them as you create, insert, append, removem, and feed operations 5. Creation: only two constructors: 1. default: just empty data object 2. create by adding data items from any standard C++ container (any that supports iteration) data type (std: array, std::vector, std::set, etc)). This may be bit hard. Search about this and really have a meaningful discussion within the team 6. Removem: remove 1 to any (m) number of data item from the data object. You must validate the existence of m number of data item before the removal 7. The data is heavily duplicated. In situations like this we discussed storing pointers as a solution in the class 8. You are not allowed to use any C/C++ statistics libraries or a library that provide direct calculations of above statistics 9. Write your entire solutions with the class name "Simple_stat" in a single header named "simple_stat.h" file and test it in a separate main program 10. In the same project since you will be using linear structures headers linked here, make sure those headers contain the copyright note, // From the software distribution accompanying the textbook // "A Practical Introduction to Data Structures and Algorithm Analysis, // Third Edition (C++)" by Clifford A. Shaffer. // Source code Copyright (C) 2007-2011 by Clifford A. Shaffer." This is very important as your project in GitHub is open source. I updated code zip file I posted with this note. So if you download the latest linked here you are good to go.