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