CS2134-Homework 4B- Enter data from the file MTA_train_stop_data.txt Solved

40.00 $ 20.00 $

Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment


Rate this product

Assignment 4b

Programming Part:
1. Enter data from the file MTA_train_stop_data.txt. The data from this assignment is from http://www.mta.info/developers/download.html. (Please note that we will only be using some of the information in this file for this assignment. )
In the batch phase you will read all the data from the file called MTA_train_stop_data.txt into a container of type vector.
Your program will define the class trainStopData. It has the following private member variables :
string stop_id; // id of train stop (1st token) string stop_name; // name of station (4th token) double stop_lat; // latitude of train stop location double stop_lon; // longitude of train stop location
Your class should also have a constructor and the following public member functions:
string get_id( ) const string get_stop_name( ) const double get_latitude( ) const double get_longitude( ) const
2. In this question you will write the code to determine if a vector contains duplicate items. Your function will return true if there are duplicates and false otherwise. You will solve this problem in four ways (i.e. you will write four functions).
(a) Use the list class to help you find the duplicates. (Use a ”brute force” technique by comparing all items with each other.)
(b) Use the STL sort algorithm, and the vector class to help you find the duplicates
(c) Use the set class to help you find duplicates
(d) Use the unordered set class to help you find duplicates
Written Part
1. In programming question 2, what are the average case and the worst case running times for each of the different ways you used to find duplicates? Write your answers using big-Oh notation.

  • Homework-4B-rdurwc.zip