Question: stantiate the DSA _ Lab 2 class to use these methods. Let me know if you need further assistance! You Overview The std::vector class is

stantiate the DSA_Lab2 class to use these methods. Let me know if you need further assistance!
You
Overview The std::vector class is a templated sequence container class that stores data contiguously (through the internal use of a dynamic array). This enables them to be used in place of arrays, and provide additional flexibility, without having to completely refactor the code. This lab focuses on using several of the key methods provided by the class. While the last lab focused on writing your own version of the class, it is just as important to be able to use the built-in versions provided by the language. Things to Review Calling class methods Binary file I/O New Topics File headers (metadata) Iterators Data Members mValues The main vector that will be used within every single method mPalindromes This vector will only be used in the MovePalindromes method 2 Methods IsPalindromeNumber Checks to see if the value passed in is a palindrome or not This value can be any number of digits (1-N) A palindrome is any sequence that reads the same forwards and backwards Fill (from file) Fill the values vector with the contents of the binary file This file contains a four-byte header section that represents the number of values to be read and stored in the vector Fill (from array) Fill the values vector with the contents of the passed-in array Clear Removes all elements from the values vector Decreases the capacity of the vector to 0 There are two methods within the vector class to handle this Sort Sorts the values vector, based on the value of the parameter Use the std::sort method to handle the sort [](Array Subscript) operator Returns an individual element from the values vector No need for error-checking, same as std::vector Contains Determines if a value is present in the values vector 3 MovePalindromes The values vector is populated with a number of values. Iterate through this vector and move all of these values into the palindromes vector. This will require adding them to palindromes and erasing them from values Ensure that the order of the palindromes is the same Pseudo-code o Iterate through the values vector If the value is a palindrome (remember you have a method to check this) Add it to the palindromes vector Remove it from the values vector

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!