SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
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. In a(n) ____ copy - each pointer refers to its own data.
deep copy
deep
20
nodes
2. The assignment statement *p=78; changes the content of memory location 1800 and therefore also changes the content of ____.
destructor
=
deep copy
num
3. What is the equivalent postfix expression for the infix expression: (x - y) * (v + w)?
x y - v w + *
To manage objects of a given type
copy
nodes
4. Each pointer refers to its own data
O(1)
num
constructor
deep copy
5. Which of the following notations requires the use of parentheses?
shallow
prevent shallow copying of data
infix
23
6. Which answer most accurately completes the following sentence: A linked list is made up of ____.
nodes
copy
8
2
7. The _______ member function is common to all containers.
20
destructor
deep
2nd book from the top
8. You can initialize a pointer variable by setting it to ____
dynamic
a or b
num
deep copy
9. The increment operator ______ increments the value of a pointer variable by twice the size of the memory to which it is pointing.
8
does not
constructor
destructor
10. The data type of each ____ depends on the specific application.
a pointer not in the list
deep copy
O(1)
node
11. The time complexity of the linear search function in an array list is ____.
O(n)
first 1
constructor
8
12. If you applied the operation pop to the stack above - which book would be left on top of the stack?
23
2nd book from the top
nodes
#include <deque>
13. An array created during the execution of a program is called a ____ array.
reverse_iterator
pop_back
memory
dynamic
14. 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.
To manage objects of a given type
The element at the bottom
=
a or b
15. An array created during the execution of a program is called a
5 2 7
infix
dynamic array
class templates
16. A class that contains a pointer variable as one of its data members should contain an overloaded assignment operator to
The element at the bottom
protected
prevent memory leaks
O(n)
17. Which element of a stack has been in the stack the longest?
shallow
The element at the bottom
23
address of p (1200)
18. Every container contains the type
reverse_iterator
num
deep copy
constructor
19. 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.
does not
=
x y - v w + *
a or b
20. Which statement must be included in a program in order to use a deque container?
#include <deque>
dynamic array
The element at the bottom
To manage objects of a given type
21. The statement "q++" increments the value of q by ____ bytes. (double *q;)
infix
constructor
8
end
22. In a(n) ____ copy - two or more pointers of the same type point to the same memory
shallow
double-ended queue
2
num
23. What is the time-complexity of the overloaded assignment operator?
Returns the iterator of the previous nth element
nodes
=
O(n)
24. 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
pop_back
protected
a or b
first 1
25. &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 ____.
prevent memory leaks
address of p (1200)
deep
x y - v w + *
26. Given container ct - what is the effect of ct.rbegin()?
=
Returns a pointer to the last element in container ct
deep
nodes
27. What is the effect of the following expression: rAccessIterator - n?
shallow
destructor
20
Returns the iterator of the previous nth element
28. intStack.push(18); intStack.push(21); intStack.push(25); cout<<tempStack.top()<<"";
deep copy
dynamic
25 21 18
destructor
29. A class that contains a pointer variable as one of its data members should contain a destructor to
num
double-ended queue
prevent memory leaks
prevent shallow copying of data
30. A derived class can directly access ____.
copy
public members of a base class
function template
pop_back
31. What is the value of the postfix expression: 5 4 * 3 + ?
a pointer not in the list
23
function template
Returns the iterator of the previous nth element
32. What does the term deque stand for?
nodes
a or b
dynamic
double-ended queue
33. What are containers used for?
infix
To manage objects of a given type
constructor
dynamic array
34. If your class contains a pointer variable as one of its data members - having a destructor would prevent ____ leaks.
8
destructor
O(1)
memory
35. With templates - you can write a single code segment for a set of related functions - called a ____.
is-a
=
pop_back
function template
36. If you don't want a pointer to point to anything you should initialize it by setting it to
x y - v w + *
dynamic array
a or b
37. In a single inheritance - the derived class is derived from ____base class(es).
O(n)
dynamic
one
public members of a base class
38. vector<int> v (1 - 2); int value = v.back (); cout << value << endl; What is the output of the code fragment above?
8
O(1)
2
isFull & listSize
39. When initializing the object of a derived class - the ____ of the base class is executed first.
constructor
8
5 2 7
To manage objects of a given type
40. Which of the following should be used to traverse a list?
O(1)
public members of a base class
end
a pointer not in the list
41. The function _____ can be used with any container type including arrays.
2nd book from the top
end
deep copy
copy
42. Which function is common to all sequence containers but NOT all containers?
deep copy
23
pop_back
2nd book from the top
43. 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.
protected
O(n)
nodes
memory
44. The time complexity of the function isEmpty in an array list is
deep copy
O(1)
23
class templates
45. Like function templates - ____ are used to write a single code segment for a set of related classes.
function template
class templates
O(n)
O(n)
46. Building a linked list forward places the item to be added at the ____ of the linked list.
end
address of p (1200)
23
20
47. Inheritance is an example of the ____ relationship.
destructor
deep copy
is-a
Returns a pointer to the last element in container ct
48. v[0] = 5; v[1] = 2; v[2] = 7; vector<int>::iterator first = v.begin(); vector<int>::iterator last = v.end();
is-a
memory
5 2 7
public members of a base class
49. 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?
23
one
a or b
20
50. In an array list the time complexity of the isEmpty function is identical to the time complexity of the ____ function.
isFull & listSize
shallow
To manage objects of a given type
25 21 18