C++ CST 280 Week 2 Practice 2A

Feb 3rd, 2012
Studypool Tutor
Delta College
Course: CST280
Price: $10 USD

Tutor description

CST 280 In-Class Practice – Week 2 Access the file unorderPrac.cpp from the course web materials (code pq6v). Create a new Visual C++ project. A file is required – you can either create your own of use an example from the course materials. Then, complete the two missing functions that will insert a new element at the front of an unordered list. UnOrdInsertFrontRand : Insert an element at front of the list without any regard to the impact to the order of other elements in the list. List items can end up anywhere as long as they remain in the list. UnOrdInsertFrontFixed Insert an element at front of the list while maintaining the given sequence of the other elements in the list. /************************************************************/ /* This function receives an integer, an array containing */ /* an unordered list, and the size of the list. It inserts */ /* a new integer item at the beginning of the list. */ /* */ /************************************************************/

Word Count: 512
Showing Page: 1/3
// CPPWeek2Practice2A.cpp//#include "stdafx.h"#include #include using namespace std;const int MAX_LIST_SIZE = 100; // Max list size// Function prototypesvoid GetList(int inList[], int& listsize, int maxlistsize);void DisplayList(int theList[], int listsize);void UnOrdInsert(int list[], int& numElems, int newint);void UnOrdDelete(int list[], int& numElems, int oldint);void UnOrdInsertFrontRand(int list[], int& numElems, int newint);void UnOrdInsertFrontFixed(int list[], int& numElems, int newint);int _tmain(int argc, _TCHAR* argv[]){int InList[MAX_LIST_SIZE]; // Array of list elementsint ListSize; // Index of last list elementGetList(InList, ListSize, MAX_LIST_SIZE);cout << endl << "Initial list:" << endl;DisplayList(InList, ListSize);UnOrdInsert(InList, ListSize, 10); // Insert value of 10cout <

Review from student

Studypool Student
" Top quality work from this guy! I'll be back! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1819 tutors are online

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors