Question
Meed help on this code: class DSA_Lab4 { friend class UnitTests_Lab4; // Giving access to test code // Data members std::list mList; public: // Add
Meed help on this code:
class DSA_Lab4 {
friend class UnitTests_Lab4; // Giving access to test code
// Data members std::list
public:
// Add all of the values from the array into the list using queue ordering // // In: _arr The array of values // _size The number of elements in the array void QueueOrderingAdd(const float* _arr, size_t _size) { // TODO: Implement this method }
// Add all of the values from the array into the list using stack ordering // // In: _arr The array of values // _size The number of elements in the array void StackOrderingAdd(const float* _arr, size_t _size) { // TODO: Implement this method }
// Remove a single value from the list using queue ordering // // Return: The value that was removed float QueueOrderingRemove() { // TODO: Implement this method }
// Remove a single value from the list using stack ordering // // Return: The value that was removed float StackOrderingRemove() { // TODO: Implement this method }
// Insert a value _index nodes away from the head node // If _index is 0 - insert in front of the head/front node // If _index is 5 - insert in front of the 5th node in the list // // Example: // 0<-[5]<->[1]<->[6]<->[4]<->[2]->0 // // Inserting a 7 at index 2 // // 0<-[5]<->[1]<->[7]<->[6]<->[4]<->[2]->0 // // // In: _index The "index" to add at // _val The value to insert void Insert(int _index, float _val) { // TODO: Implement this method }
// Insert a value at the spot specified by the iterator passed in // // In: _iter The iterator at the place to insert // _val The value to insert void Insert(std::list
// Remove all values from mList that have a decimal value > _decimal // Example: // _decimal 0.5 // // 2.84 - removed // 0.5 - not removed // 482.043 - removed // // In: _decimal The decimal value to check against // // Return: The total number of values removed int RemoveDecimalGreater(float _decimal) { // TODO: Implement this method } };
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started