Docsity

Vector Implementation - Data Structures - Lab 4 | CSCI 1200, Lab Reports of Data Structures and Algorithms

Toggle sidebar
bg1
Computer Science II — CSci 1200
Lab 4
Vector Implementation
Introduction
This lab explores more of the implementation of the vector class. Please
download
http://www.cs.rpi.edu/academics/courses/spring08/cs2/lab04/Vec.h
http://www.cs.rpi.edu/academics/courses/spring08/cs2/lab04/test_vec.cpp
and then turn off all network connections.
Checkpoints
1. Complete the implementation and testing of the push_back and erase
member functions of the Vec<T>. The main function in main_vec.cpp
includes code to do the testing for you.
2. Write the resize member function. Note that you are not allowed to use
push_back in your implementation. Add code to the main program
to test this function. (Hint: apply resize to z a few times.)

Partial preview of the text

Download Vector Implementation - Data Structures - Lab 4 | CSCI 1200 and more Lab Reports Data Structures and Algorithms in PDF only on Docsity!

Computer Science II — CSci 1200

Lab 4

Vector Implementation

Introduction

This lab explores more of the implementation of the vector class. Please download

http://www.cs.rpi.edu/academics/courses/spring08/cs2/lab04/Vec.h http://www.cs.rpi.edu/academics/courses/spring08/cs2/lab04/test_vec.cpp

and then turn off all network connections.

Checkpoints

  1. Complete the implementation and testing of the push_back and erase member functions of the Vec. The main function in main_vec.cpp includes code to do the testing for you.
  2. Write the resize member function. Note that you are not allowed to use push_back in your implementation. Add code to the main program to test this function. (Hint: apply resize to z a few times.)