Skip to content

Kenyon-CS/USStateAlgorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

USStateAlgorithms

Using the US States to demonstrate C++ STL algorithms

Here’s the structure for a C++ program that will demonstrate many STL algorithms, using state data stored in a class and loaded from a CSV file:

Steps

  1. Class Definition: Create a State class to store state data.
  2. CSV Parsing: Load state data from a CSV file into a vector of State objects.
  3. Sorting: Demonstrate sorting by state name, population, and per capita GDP.
  4. Partitioning: Partition states based on population and also randomly into two vectors.
  5. Searching: Search for states by a keyword in the state motto.
  6. Transforming: Apply a 20% population growth transformation.
  7. Set Operations: Perform union and intersection on random state vectors.
  8. Numeric Operations: Compute the sum of area, GDP, and population.

About

Using the US States to demonstrate C++ STL algorithms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published