1. Which of the following operations of the ADT stack does not throw a StackExce
ID: 3773742 • Letter: 1
Question
1.
Which of the following operations of the ADT stack does not throw a StackException?
a. pop
b. isEmpty
c. getTop
2.
A pointer-based stack must use a(n) ______.
a. integer variable that defines the top of the stack
b. compiler-generated copy constrictor
c. explicit copy constructor
3.
Which of the following operations of the binary search tree implementation of the ADT tree is always O(n)?
a. deletion
b. retrieval
c. traversal
4.
Which of the following code fragments deletes the item at the front of a queue represented by a circular array?
a. front = MAX_QUEUE - front;--count;
b. front = (front+1) % MAX_QUEUE;--count;
c. front = (back+1) % MAX_QUEUE;--count;
5.
Operations on a queue occur at ______.
a. its front only
b. its back only
c. both its front and back
6.
Which of the following C++ statements insert a new node, pointed to by newPtr, into an empty queue represented by a linear linked list?
a. frontPtr = newPtr;
backPtr = newPtr;
b. backPtr->next = newPtr;
frontPtr = newPtr;
c. newPtr->next = backPtr;
7.
The ______ operation is the most significant difference between the ADT priority queue and the ADT table.
a. pqIsEmpty
b. pqInsert
c. pqDelete
8.
A(n) ______ allows two modules to communicate with each other.
a. axiom
b. interface
c. client
9.
Which of the following class declarations indicates that Ball is a derived class of Sphere?
a. class Sphere: public Ball
b. class Ball: public Sphere
c. class Ball::Sphere
10.
The ______ specifies the actual data type when declaring an instance of a class template.
a. programmer
b. constructor
c. client
11.
In the ADT list, when an item is deleted from position i of the list, ______.
a. the position of all items is decreased by 1
b. the position of each item that was at a position smaller than i is decreased by 1
c. the position of each item that was at a position greater than i is decreased by 1
12.
The insertion operation of the ADT list can insert new items ______.
a. only at the front of the list
b. only at the end of the list
c. into any position of the list
13.
A class's ______ members can only be used by its own methods and friends.
a. protected
b. private
c. final
14.
______ describes the ability of a variable name to represent, during program execution, instances of different but related classes that descend from a common superclass.
a. Containment
b. Polymorphism
c. Encapsulation
15.
A subclass inherits all of the following members of its superclass EXCEPT ______.
a. protected methods
b. constructors and destructor
c. public methods
16.
Which of the following declares a list of characters using a class template?
a. List <char> charList;
b. List <T> charList;
c. List(char) <T> charList;
17.
___________ sort can be implemented as in-place sort..
a. Mergesort
b. Insertion sort
c. None of the choices apply
18.
The __________ key is the part of a record that determines the sorted order of the entire record within a collection of records..
a. internal
b. sort
c. none of the choices apply
19.
The ______ compares adjacent items and exchanges them if they are out of order.
a. binary search
b. bubble sort
c. quicksort
20.
For large arrays, the insertion sort is prohibitively:
a. inefficient.
b. effective.
c. none of the choices apply.
21.
In the worst case, a binary search is ______.
a. O(n)
b. O(1)
c. O(log2n)
d. O(n2)
22.
The worst scenario for insertion sort is
a. 9 8 7 6 5 4 3 2 1
b. 8 2 6 4 5 3 7 1 9
c. 5 6 3 8 9 2 1 7 4
23.
Which one of the following ADTs is position-oriented?
a. binary tree
b. table
c. priority queue
24.
A node on the path from the root to node n is a(n) ______ of node n.
a. ancestor
b. subtree
c. leaf
25.
The node of a tree that has no parent is called a(n) ______.
a. edge
b. vertex
c. leaf
26.
Traversal methods in a pointer-based implementation of a binary tree should be declared as ______ members to enable recursion.
a. private
b. protected
c. const
27.
In the following STL declaration of an adjacency list, what does the map pair represent?
vector<map<int, int> >adjList;
a. the second vertex (key) and the edge weight (value)
b. the first vertex (key) and the second vertex (value)
c. the first vertex (key) and the key (value)
28.
All ______ begin and end at the same vertex and do not pass through any other vertices more than once.
a. paths
b. simple paths
c. simple cycles
29.
A ______ is an undirected connected graph without cycles.
a. tree
b. multigraph
c. connected component
30.
A path is a sequence of ______ in a graph.
a. edges
b. subgraphs
c. cycles
31.
A graph-traversal algorithm stops when it ______.
a. first encounters the designated destination vertex
b. has visited all the vertices that it can reach
c. has visited all the vertices and has returned to the origin vertex
32.
Which of the following is NOT a required step for a deletion operation under external hashing of an index file?
a. search the index file for the index record
b. search the data file for the block of the data record
c. delete the index record from the index file
33.
In a B-tree of degree 5, an internal node (other than the root) has at least ______.
a. 1 child
b. 3 children
c. 4 children
34.
In an external table implementation in which data records are stored in search-key order, the tableRetrieve algorithm requires that you know ______ in a data-file segment.
a. the number of the first and last blocks
b. the number of the middle block
c. the number of the last block
35.
In a B-tree of degree 5, the root has at least ______.
a. 1 child
b. 2 children
c. 3 children
36.
In an external environment, the advantage of making a search tree ______ by allowing more children per node outweighs the disadvantage.
a. dense
b. short
c. tall
37.
The records of a data file are organized into one or more ______.
a. rows
b. columns
c. blocks
1.
Which of the following operations of the ADT stack does not throw a StackException?
a. pop
b. isEmpty
c. getTop
2.
A pointer-based stack must use a(n) ______.
a. integer variable that defines the top of the stack
b. compiler-generated copy constrictor
c. explicit copy constructor
3.
Which of the following operations of the binary search tree implementation of the ADT tree is always O(n)?
a. deletion
b. retrieval
c. traversal
4.
Which of the following code fragments deletes the item at the front of a queue represented by a circular array?
a. front = MAX_QUEUE - front;--count;
b. front = (front+1) % MAX_QUEUE;--count;
c. front = (back+1) % MAX_QUEUE;--count;
5.
Operations on a queue occur at ______.
a. its front only
b. its back only
c. both its front and back
6.
Which of the following C++ statements insert a new node, pointed to by newPtr, into an empty queue represented by a linear linked list?
a. frontPtr = newPtr;
backPtr = newPtr;
b. backPtr->next = newPtr;
frontPtr = newPtr;
c. newPtr->next = backPtr;
7.
The ______ operation is the most significant difference between the ADT priority queue and the ADT table.
a. pqIsEmpty
b. pqInsert
c. pqDelete
8.
A(n) ______ allows two modules to communicate with each other.
a. axiom
b. interface
c. client
9.
Which of the following class declarations indicates that Ball is a derived class of Sphere?
a. class Sphere: public Ball
b. class Ball: public Sphere
c. class Ball::Sphere
10.
The ______ specifies the actual data type when declaring an instance of a class template.
a. programmer
b. constructor
c. client
11.
In the ADT list, when an item is deleted from position i of the list, ______.
a. the position of all items is decreased by 1
b. the position of each item that was at a position smaller than i is decreased by 1
c. the position of each item that was at a position greater than i is decreased by 1
12.
The insertion operation of the ADT list can insert new items ______.
a. only at the front of the list
b. only at the end of the list
c. into any position of the list
13.
A class's ______ members can only be used by its own methods and friends.
a. protected
b. private
c. final
14.
______ describes the ability of a variable name to represent, during program execution, instances of different but related classes that descend from a common superclass.
a. Containment
b. Polymorphism
c. Encapsulation
15.
A subclass inherits all of the following members of its superclass EXCEPT ______.
a. protected methods
b. constructors and destructor
c. public methods
16.
Which of the following declares a list of characters using a class template?
a. List <char> charList;
b. List <T> charList;
c. List(char) <T> charList;
17.
___________ sort can be implemented as in-place sort..
a. Mergesort
b. Insertion sort
c. None of the choices apply
18.
The __________ key is the part of a record that determines the sorted order of the entire record within a collection of records..
a. internal
b. sort
c. none of the choices apply
19.
The ______ compares adjacent items and exchanges them if they are out of order.
a. binary search
b. bubble sort
c. quicksort
20.
For large arrays, the insertion sort is prohibitively:
a. inefficient.
b. effective.
c. none of the choices apply.
21.
In the worst case, a binary search is ______.
a. O(n)
b. O(1)
c. O(log2n)
d. O(n2)
22.
The worst scenario for insertion sort is
a. 9 8 7 6 5 4 3 2 1
b. 8 2 6 4 5 3 7 1 9
c. 5 6 3 8 9 2 1 7 4
23.
Which one of the following ADTs is position-oriented?
a. binary tree
b. table
c. priority queue
24.
A node on the path from the root to node n is a(n) ______ of node n.
a. ancestor
b. subtree
c. leaf
25.
The node of a tree that has no parent is called a(n) ______.
a. edge
b. vertex
c. leaf
26.
Traversal methods in a pointer-based implementation of a binary tree should be declared as ______ members to enable recursion.
a. private
b. protected
c. const
27.
In the following STL declaration of an adjacency list, what does the map pair represent?
vector<map<int, int> >adjList;
a. the second vertex (key) and the edge weight (value)
b. the first vertex (key) and the second vertex (value)
c. the first vertex (key) and the key (value)
28.
All ______ begin and end at the same vertex and do not pass through any other vertices more than once.
a. paths
b. simple paths
c. simple cycles
29.
A ______ is an undirected connected graph without cycles.
a. tree
b. multigraph
c. connected component
30.
A path is a sequence of ______ in a graph.
a. edges
b. subgraphs
c. cycles
31.
A graph-traversal algorithm stops when it ______.
a. first encounters the designated destination vertex
b. has visited all the vertices that it can reach
c. has visited all the vertices and has returned to the origin vertex
32.
Which of the following is NOT a required step for a deletion operation under external hashing of an index file?
a. search the index file for the index record
b. search the data file for the block of the data record
c. delete the index record from the index file
33.
In a B-tree of degree 5, an internal node (other than the root) has at least ______.
a. 1 child
b. 3 children
c. 4 children
34.
In an external table implementation in which data records are stored in search-key order, the tableRetrieve algorithm requires that you know ______ in a data-file segment.
a. the number of the first and last blocks
b. the number of the middle block
c. the number of the last block
35.
In a B-tree of degree 5, the root has at least ______.
a. 1 child
b. 2 children
c. 3 children
36.
In an external environment, the advantage of making a search tree ______ by allowing more children per node outweighs the disadvantage.
a. dense
b. short
c. tall
37.
The records of a data file are organized into one or more ______.
a. rows
b. columns
c. blocks
Explanation / Answer
1)Which of the following operations of the ADT stack does not throw a StackException?
Ans:b. isEmpty
2)A pointer-based stack must use a(n) ______.
Ans:a. integer variable that defines the top of the stack
3)Which of the following operations of the binary search tree implementation of the ADT tree is always O(n)?
Ans:b. retrieval
4)Which of the following code fragments deletes the item at the front of a queue represented by a circular array?
Ans:b. front = (front+1) % MAX_QUEUE;--count;
5)Operations on a queue occur at ______.
Ans: c. both its front and back
6)Which of the following C++ statements insert a new node, pointed to by newPtr, into an empty queue represented by a linear linked list?
Ans: frontPtr = newPtr;
backPtr = newPtr;
7)The ______ operation is the most significant difference between the ADT priority queue and the ADT table.
Ans: pqDelete
8)A(n) ______ allows two modules to communicate with each other.
Ans: interface
9)Which of the following class declarations indicates that Ball is a derived class of Sphere?
Ans: class Ball::Sphere
10)The ______ specifies the actual data type when declaring an instance of a class template
Ans: c. client
11)In the ADT list, when an item is deleted from position i of the list, ______.
Ans:c. the position of each item that was at a position greater than i is decreased by 1
12)The insertion operation of the ADT list can insert new items ______.
Ans: into any position of the list
13)A class's ______ members can only be used by its own methods and friends.
Ans: protected
14)______ describes the ability of a variable name to represent, during program execution, instances of different but related classes that descend from a common superclass.
Ans: Containment
15) Ans: protected methods
16)Ans: List <T> charList;
17)Ans: Insertion sort
18)Ans:sort
19)Ans: quicksort
20)Ans: inefficient.
21)Ans: O(log2 n)
22)Ans:a. 9 8 7 6 5 4 3 2 1
23)Ans:binary tree
24)Ans: leaf
25)Ans: vertex
26)Ans:private
27)Ans:. the first vertex (key) and the second vertex (value)
28)Ans: simple cycles
29)Ans: tree
30)Ans: edges
31)Ans: has visited all the vertices and has returned to the origin vertex
32)Ans: delete the index record from the index file
33)Ans: 4 children
34)Ans:he number of the first and last blocks
35)Ans:2 children
36)Ans:dense
37)Ans:blocks
1)Which of the following operations of the ADT stack does not throw a StackException?
Ans:b. isEmpty
2)A pointer-based stack must use a(n) ______.
Ans:a. integer variable that defines the top of the stack
3)Which of the following operations of the binary search tree implementation of the ADT tree is always O(n)?
Ans:b. retrieval
4)Which of the following code fragments deletes the item at the front of a queue represented by a circular array?
Ans:b. front = (front+1) % MAX_QUEUE;--count;
5)Operations on a queue occur at ______.
Ans: c. both its front and back
6)Which of the following C++ statements insert a new node, pointed to by newPtr, into an empty queue represented by a linear linked list?
Ans: frontPtr = newPtr;
backPtr = newPtr;
7)The ______ operation is the most significant difference between the ADT priority queue and the ADT table.
Ans: pqDelete
8)A(n) ______ allows two modules to communicate with each other.
Ans: interface
9)Which of the following class declarations indicates that Ball is a derived class of Sphere?
Ans: class Ball::Sphere
10)The ______ specifies the actual data type when declaring an instance of a class template
Ans: c. client
11)In the ADT list, when an item is deleted from position i of the list, ______.
Ans:c. the position of each item that was at a position greater than i is decreased by 1
12)The insertion operation of the ADT list can insert new items ______.
Ans: into any position of the list
13)A class's ______ members can only be used by its own methods and friends.
Ans: protected
14)______ describes the ability of a variable name to represent, during program execution, instances of different but related classes that descend from a common superclass.
Ans: Containment
15) Ans: protected methods
16)Ans: List <T> charList;
17)Ans: Insertion sort
18)Ans:sort
19)Ans: quicksort
20)Ans: inefficient.
21)Ans: O(log2 n)
22)Ans:a. 9 8 7 6 5 4 3 2 1
23)Ans:binary tree
24)Ans: leaf
25)Ans: vertex
26)Ans:private
27)Ans:. the first vertex (key) and the second vertex (value)
28)Ans: simple cycles
29)Ans: tree
30)Ans: edges
31)Ans: has visited all the vertices and has returned to the origin vertex
32)Ans: delete the index record from the index file
33)Ans: 4 children
34)Ans:he number of the first and last blocks
35)Ans:2 children
36)Ans:dense
37)Ans:blocks
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.