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