SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
Search
Test your basic knowledge |
Data Structures Using C++
Start Test
Study First
Subject
:
it-skills
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. What is the effect of the following expression: rAccessIterator - n?
Returns the iterator of the previous nth element
dynamic array
prevent shallow copying of data
nodes
2. If you don't want a pointer to point to anything you should initialize it by setting it to
class templates
double-ended queue
public members of a base class
3. The assignment statement *p=78; changes the content of memory location 1800 and therefore also changes the content of ____.
reverse_iterator
2
infix
num
4. Suppose your class contains a pointer variable as one of its data members. When performing member-wise copies between two objects of the same class - its important to have an overloaded ____ operator to prevent shallow copying of data.
8
=
memory
prevent memory leaks
5. A derived class can directly access ____.
public members of a base class
dynamic array
#include <deque>
protected
6. In a single inheritance - the derived class is derived from ____base class(es).
8
one
2
double-ended queue
7. The statement "q++" increments the value of q by ____ bytes. (double *q;)
prevent shallow copying of data
23
The element at the bottom
8
8. Which function is common to all sequence containers but NOT all containers?
#include <deque>
pop_back
first 1
copy
9. Which answer most accurately completes the following sentence: A linked list is made up of ____.
Returns a pointer to the last element in container ct
a pointer not in the list
is-a
nodes
10. What is the value of the postfix expression: 5 4 * 3 + ?
23
function template
5 2 7
a or b
11. Each pointer refers to its own data
25 21 18
Returns the iterator of the previous nth element
deep copy
O(1)
12. If you applied the operation pop to the stack above - which book would be left on top of the stack?
shallow
is-a
2nd book from the top
Returns the iterator of the previous nth element
13. Which of the following should be used to traverse a list?
a pointer not in the list
25 21 18
double-ended queue
20
14. If your class contains a pointer variable as one of its data members - having a destructor would prevent ____ leaks.
one
nodes
memory
dynamic array
15. The _______ member function is common to all containers.
public members of a base class
destructor
memory
deep copy
16. An array created during the execution of a program is called a ____ array.
The element at the bottom
prevent memory leaks
public members of a base class
dynamic
17. Which statement must be included in a program in order to use a deque container?
node
a or b
#include <deque>
The element at the bottom
18. What is the equivalent postfix expression for the infix expression: (x - y) * (v + w)?
O(n)
prevent shallow copying of data
dynamic array
x y - v w + *
19. v[0] = 5; v[1] = 2; v[2] = 7; vector<int>::iterator first = v.begin(); vector<int>::iterator last = v.end();
5 2 7
deep copy
To manage objects of a given type
20
20. The time complexity of the function isEmpty in an array list is
O(1)
=
prevent shallow copying of data
Returns a pointer to the last element in container ct
21. &p is equivalent to: 1200 *p means the content of the memory location 1800 - pointed to by p; that is - pointed to by the content of memory location ____.
#include <deque>
address of p (1200)
O(1)
25 21 18
22. In an array list the time complexity of the isEmpty function is identical to the time complexity of the ____ function.
dynamic
constructor
x y - v w + *
isFull & listSize
23. template<class inputIterator -class outputIterator>outputItr copy(inputIteratorfirst1 - inputIterator last - outputIterator first2); From the function prototype copy above - which parameter specifies the position from which to begin copying the eleme
end
Returns the iterator of the previous nth element
first 1
prevent shallow copying of data
24. A base class wants to allow a derived class to access one of its data members. However - the base class does not want this member to be directly accessed outside the class. The base class should declare the member using the ____ access specifier.
address of p (1200)
reverse_iterator
first 1
protected
25. The increment operator ______ increments the value of a pointer variable by twice the size of the memory to which it is pointing.
does not
copy
O(n)
infix
26. The function _____ can be used with any container type including arrays.
end
8
prevent shallow copying of data
copy
27. In a(n) ____ copy - two or more pointers of the same type point to the same memory
Returns a pointer to the last element in container ct
function template
reverse_iterator
shallow
28. The time complexity of the linear search function in an array list is ____.
O(n)
dynamic
isFull & listSize
a pointer not in the list
29. An array created during the execution of a program is called a
dynamic array
O(n)
2nd book from the top
deep copy
30. What is the time-complexity of the overloaded assignment operator?
memory
O(n)
x y - v w + *
does not
31. With templates - you can write a single code segment for a set of related functions - called a ____.
function template
nodes
O(n)
copy
32. Which element of a stack has been in the stack the longest?
double-ended queue
Returns the iterator of the previous nth element
The element at the bottom
2nd book from the top
33. vector<int> v (1 - 10); vector<int> w (1 -20); v.swap (w); cout << v[0]; What is the output of the code fragment above?
2nd book from the top
deep copy
20
is-a
34. In a(n) ____ copy - each pointer refers to its own data.
is-a
deep
O(n)
=
35. vector<int> v (1 - 2); int value = v.back (); cout << value << endl; What is the output of the code fragment above?
8
num
To manage objects of a given type
2
36. The data type of each ____ depends on the specific application.
is-a
first 1
node
O(n)
37. When initializing the object of a derived class - the ____ of the base class is executed first.
num
The element at the bottom
constructor
pop_back
38. Given container ct - what is the effect of ct.rbegin()?
shallow
deep
Returns a pointer to the last element in container ct
infix
39. A class that contains a pointer variable as one of its data members should contain an overloaded assignment operator to
5 2 7
prevent memory leaks
23
deep
40. Which of the following notations requires the use of parentheses?
a pointer not in the list
25 21 18
destructor
infix
41. Every container contains the type
5 2 7
a pointer not in the list
destructor
reverse_iterator
42. You can initialize a pointer variable by setting it to ____
shallow
23
constructor
a or b
43. What are containers used for?
double-ended queue
protected
isFull & listSize
To manage objects of a given type
44. Building a linked list forward places the item to be added at the ____ of the linked list.
O(n)
num
is-a
end
45. Like function templates - ____ are used to write a single code segment for a set of related classes.
class templates
a pointer not in the list
protected
infix
46. What does the term deque stand for?
Returns the iterator of the previous nth element
23
25 21 18
double-ended queue
47. Inheritance is an example of the ____ relationship.
=
is-a
does not
O(1)
48. intStack.push(18); intStack.push(21); intStack.push(25); cout<<tempStack.top()<<"";
20
25 21 18
O(n)
8
49. A class that contains a pointer variable as one of its data members should contain a destructor to
shallow
prevent shallow copying of data
reverse_iterator
one
50. Suppose your class contains a pointer variable as one of its data members. When performing member-wise copies between two objects of the same class - its important to have an overloaded ____ operator to prevent shallow copying of data.
shallow
deep
address of p (1200)
=