Question: Given a vector: vector vectorArray = {1,2,3,4,5}; Below is how we traverse through it: for (int i = 0; i < vectorArray .size(); i++)

Given a vector: vector vectorArray = {1,2,3,4,5}; Below is how we traverse through it: for (int i = 0; i < vectorArray .size(); i++) { } //do somthine with vectorArray[i] Apply the same idea, if we have a List of 5 incremental elements from 1 to 5, and a pointer pntr pointing to the head off the list, how would we traverse through that list and cout each element value?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Answer include iostream include list using namespace std int main Create a list with ... View full answer
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
