Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) An application of the STACK is a) Files stored in folders and subfolders nter

ID: 3907245 • Letter: 1

Question

1) An application of the STACK is a) Files stored in folders and subfolders nternet Web browser stores recently visited sites, we return to most recently visited first c) TCP/P packets being checked as they come into port 2) To write the definition of a function template we specify type with a) templatecint I> b) int(template int) c) template d) template 3) To change the size of a vector named vec, use a) vec.change_size(5) c.resize(5) c) vec.scale(5) d) vec.align(5). e) vector can't be resized. 4) In an array named arr of size 5, if we cout

Explanation / Answer

1. (B) Stack follows LIFO property. The browser can insert recently used webpages in the stack and retrieve the topmost page from the stack to get the most recently viewed page and so on.

2. (C) Templates can be specified using either : template<typename T> or template<class T>

3. (B) vector.resize(int n) is used to resize the vector to size n

4. (B) C++ performs no bound checking for arrays as they are expose raw memory.

5. (B) C++ performs no bound checking for vectors when elements are accessed using [] operator. However, if at() methoisf vector is used, it checks for bounds.