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 function _____ can be used with any container type including arrays.
memory
copy
reverse_iterator
2
2. What are containers used for?
double-ended queue
node
To manage objects of a given type
Returns the iterator of the previous nth element
3. The statement "q++" increments the value of q by ____ bytes. (double *q;)
8
does not
public members of a base class
shallow
4. A class that contains a pointer variable as one of its data members should contain a destructor to
prevent shallow copying of data
8
constructor
a or b
5. In a(n) ____ copy - two or more pointers of the same type point to the same memory
dynamic
23
prevent memory leaks
shallow
6. Building a linked list forward places the item to be added at the ____ of the linked list.
first 1
end
O(n)
copy
7. If you don't want a pointer to point to anything you should initialize it by setting it to
protected
nodes
class templates
8. &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)
23
8
9. Each pointer refers to its own data
protected
deep copy
destructor
dynamic array
10. 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?
shallow
O(1)
20
dynamic array
11. Which function is common to all sequence containers but NOT all containers?
constructor
isFull & listSize
x y - v w + *
pop_back
12. 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
double-ended queue
2nd book from the top
13. When initializing the object of a derived class - the ____ of the base class is executed first.
constructor
Returns a pointer to the last element in container ct
20
x y - v w + *
14. In a single inheritance - the derived class is derived from ____base class(es).
one
The element at the bottom
pop_back
shallow
15. The time complexity of the linear search function in an array list is ____.
x y - v w + *
O(n)
#include <deque>
2
16. Which statement must be included in a program in order to use a deque container?
#include <deque>
Returns a pointer to the last element in container ct
2
pop_back
17. An array created during the execution of a program is called a ____ array.
23
dynamic
infix
isFull & listSize
18. 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.
class templates
=
shallow
deep
19. The increment operator ______ increments the value of a pointer variable by twice the size of the memory to which it is pointing.
does not
O(1)
node
=
20. What is the equivalent postfix expression for the infix expression: (x - y) * (v + w)?
destructor
num
memory
x y - v w + *
21. With templates - you can write a single code segment for a set of related functions - called a ____.
reverse_iterator
function template
a pointer not in the list
infix
22. Which of the following should be used to traverse a list?
constructor
a pointer not in the list
Returns a pointer to the last element in container ct
25 21 18
23. A derived class can directly access ____.
protected
public members of a base class
deep copy
pop_back
24. v[0] = 5; v[1] = 2; v[2] = 7; vector<int>::iterator first = v.begin(); vector<int>::iterator last = v.end();
nodes
#include <deque>
5 2 7
prevent memory leaks
25. In an array list the time complexity of the isEmpty function is identical to the time complexity of the ____ function.
copy
25 21 18
isFull & listSize
public members of a base class
26. An array created during the execution of a program is called a
pop_back
#include <deque>
protected
dynamic array
27. Every container contains the type
2nd book from the top
one
reverse_iterator
copy
28. A class that contains a pointer variable as one of its data members should contain an overloaded assignment operator to
isFull & listSize
prevent memory leaks
is-a
=
29. In a(n) ____ copy - each pointer refers to its own data.
deep
deep copy
end
a or b
30. What is the time-complexity of the overloaded assignment operator?
x y - v w + *
O(n)
pop_back
Returns a pointer to the last element in container ct
31. The data type of each ____ depends on the specific application.
a pointer not in the list
deep copy
node
one
32. The assignment statement *p=78; changes the content of memory location 1800 and therefore also changes the content of ____.
=
x y - v w + *
infix
num
33. vector<int> v (1 - 2); int value = v.back (); cout << value << endl; What is the output of the code fragment above?
x y - v w + *
2
end
deep copy
34. Which answer most accurately completes the following sentence: A linked list is made up of ____.
reverse_iterator
nodes
one
first 1
35. Inheritance is an example of the ____ relationship.
Returns the iterator of the previous nth element
public members of a base class
a or b
is-a
36. The _______ member function is common to all containers.
memory
20
dynamic array
destructor
37. Which of the following notations requires the use of parentheses?
shallow
infix
O(n)
8
38. What does the term deque stand for?
5 2 7
one
2
double-ended queue
39. intStack.push(18); intStack.push(21); intStack.push(25); cout<<tempStack.top()<<"";
dynamic array
deep
end
25 21 18
40. Which element of a stack has been in the stack the longest?
address of p (1200)
one
The element at the bottom
25 21 18
41. What is the effect of the following expression: rAccessIterator - n?
prevent shallow copying of data
Returns the iterator of the previous nth element
class templates
one
42. 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
is-a
first 1
shallow
To manage objects of a given type
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.
infix
address of p (1200)
20
protected
44. Like function templates - ____ are used to write a single code segment for a set of related classes.
double-ended queue
class templates
constructor
O(1)
45. You can initialize a pointer variable by setting it to ____
double-ended queue
class templates
reverse_iterator
a or b
46. What is the value of the postfix expression: 5 4 * 3 + ?
address of p (1200)
O(1)
23
dynamic
47. If your class contains a pointer variable as one of its data members - having a destructor would prevent ____ leaks.
a or b
2
x y - v w + *
memory
48. Given container ct - what is the effect of ct.rbegin()?
does not
dynamic
first 1
Returns a pointer to the last element in container ct
49. The time complexity of the function isEmpty in an array list is
one
num
The element at the bottom
O(1)
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.
copy
=
dynamic array
protected
Sorry, Topic not found.:)Seach or Brouse Basicversity:
Search
Major Subjects
Tests & Exams
AP
CLEP
DSST
GRE
SAT
GMAT
Certifications
CISSP go https://www.isc2.org/
PMP
ITIL
RHCE
MCTS
More...
IT Skills
Android Programming
Data Modeling
Objective C Programming
Basic Python Programming
Adobe Illustrator
More...
Business Skills
Advertising Techniques
Business Accounting Basics
Business Strategy
Human Resource Management
Marketing Basics
More...
Soft Skills
Body Language
People Skills
Public Speaking
Persuasion
Job Hunting And Resumes
More...
Vocabulary
GRE Vocab
SAT Vocab
TOEFL Essential Vocab
Basic English Words For All
Global Words You Should Know
Business English
More...
Languages
AP German Vocab
AP Latin Vocab
SAT Subject Test: French
Italian Survival
Norwegian Survival
More...
Engineering
Audio Engineering
Computer Science Engineering
Aerospace Engineering
Chemical Engineering
Structural Engineering
More...
Health Sciences
Basic Nursing Skills
Health Science Language Fundamentals
Veterinary Technology Medical Language
Cardiology
Clinical Surgery
More...
English
Grammar Fundamentals
Literary And Rhetorical Vocab
Elements Of Style Vocab
Introduction To English Major
Complete Advanced Sentences
Literature
Homonyms
More...
Math
Algebra Formulas
Basic Arithmetic: Measurements
Metric Conversions
Geometric Properties
Important Math Facts
Number Sense Vocab
Business Math
More...
Other Major Subjects
Science
Economics
History
Law
Performing-arts
Cooking
Logic & Reasoning
Trivia
Browse all subjects
Browse all tests
Most popular tests
//
//