Purchase Solution

trace the codes and display the resulting elements in a list

Not what you're looking for?

Ask Custom Question

Trace the following code, and display the resulting elements in the list:

int arr[] = (1, 2, 3, 4);
int arrSize = sizeof(arr)/sizeof(int);
list intList(arr, arr+arrSize);
list::iterator iter = intList.begin();
int i;

for (i=1; i <= arrSize; i++)
intList.insert(iter++, i);

Please provide a complete program if it makes sense.

Purchase this Solution

Solution Summary

It traces the codes and displays the resulting elements in a list. The response was rated '5/5' by the student who posted the question originally.

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

C# variables and classes

This quiz contains questions about C# classes and variables.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.