Deck 3: Testing and Debugging

ملء الشاشة (f)
exit full mode
سؤال
In the Java API, class java.util.Stack<E> implements a stack; there is no stack interface.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The array data field can be used for storage of a stack instead of using Java's ArrayList class.
سؤال
The statement Stack myStack = new Stack(); defines a stack that holds String objects.
سؤال
The implementation of the Stack ADT as an extension of Vector is a good choice because all the Vector methods are accessible.
سؤال
There is only one stack interface in Java.
سؤال
A(n) ____________________ is a data structure in which objects are inserted into and removed from the same end.
سؤال
A(n) ____________________ is a string that reads the same in either dierection: left to right or right to left.
سؤال
If you attempt to pop an empty stack, your program will throw a(n) ____________________.
سؤال
The ____________________ class implements a growable array of objects. Like an ArrayList, it contains components that can be accessed using an integer index.
سؤال
The ListStack class is said to be a(n) ____________________ class because it adapts the methods available in another class (List) to the interface its clients expect by giving different names to essentially the same operations.
سؤال
In terms of efficiency, all stack operations using an array structure are ____________________.
سؤال
The value of the following postfix expression is ___________________.
1 2 + 4 * 3 +
سؤال
Rewrite the following as an infix expression: 5 6 * 10 -
سؤال
A(n) ____________________ is a data structure with the property that only the top element is accessible.
سؤال
In a(n) ____________________, the top element is the data value that was most recently stored.
سؤال
The methods that make up the StackInt interface are ____.

A) push(), pop(), empty()
B) push(), pop(), peek(), empty()
C) peek(), remove(), insert()
D) peek(), insert(), isEmpty()
سؤال
The Java API includes a Stack class as part of the package java.util. This class is declared as follows:

A) public class Stack<E> implements Vector<E>
B) public class Stack<E> extends List<E>
C) public class Stack<E> extends Vector<E>
D) public class Stack<E>
سؤال
What is value of the following postfix expression?
5 6 1 + *

A) 14
B) 20
C) 30
D) 35
سؤال
Which of the following is a balanced expression?

A) (a + b * {c [d - e]}) + (d / e )
B) (a + b * {c [d - e])) + (d / e )
C) (a + b * {c [d - e])) + (d / e ]
D) (a + b * {c [d - e])}+ (d / e )
سؤال
An alternative to implementing a stack as an extension of Vector is to write a class that has a(n) ____ component.

A) array
B) List
C) Queue
D) tree
سؤال
The easiest approach to implementing a stack in Java would be to give it a(n) ____ component for storing the data.

A) LinkedStack
B) ListStack
C) SyntaxErrorException
D) List
سؤال
Rewrite the following in infix form: x1 2.5 count * 3 / +

A) x1 * 2.5 / count + 3
B) x1 + 2.5 * count / 3
C) x1 + 2.5 / count * 3
D) x1 * 2.5 + count / 3
سؤال
The method ____ returns the position of the character argument in the string.

A) String.indexOf
B) String.index
C) String.charOf
D) String.char
سؤال
The storage policy used by a stack is ____.

A) FIFO
B) LIFO
C) LIFFO
D) FIFFO
سؤال
The value of the following expression is ____.
5 7 * 3 10 + + 4 /

A) 8
B) 12
C) 20
D) 36
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/25
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 3: Testing and Debugging
1
In the Java API, class java.util.Stack<E> implements a stack; there is no stack interface.
True
2
The array data field can be used for storage of a stack instead of using Java's ArrayList class.
True
3
The statement Stack myStack = new Stack(); defines a stack that holds String objects.
True
4
The implementation of the Stack ADT as an extension of Vector is a good choice because all the Vector methods are accessible.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
5
There is only one stack interface in Java.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
6
A(n) ____________________ is a data structure in which objects are inserted into and removed from the same end.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
7
A(n) ____________________ is a string that reads the same in either dierection: left to right or right to left.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
8
If you attempt to pop an empty stack, your program will throw a(n) ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
9
The ____________________ class implements a growable array of objects. Like an ArrayList, it contains components that can be accessed using an integer index.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
10
The ListStack class is said to be a(n) ____________________ class because it adapts the methods available in another class (List) to the interface its clients expect by giving different names to essentially the same operations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
11
In terms of efficiency, all stack operations using an array structure are ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
12
The value of the following postfix expression is ___________________.
1 2 + 4 * 3 +
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
13
Rewrite the following as an infix expression: 5 6 * 10 -
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
14
A(n) ____________________ is a data structure with the property that only the top element is accessible.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
15
In a(n) ____________________, the top element is the data value that was most recently stored.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
16
The methods that make up the StackInt interface are ____.

A) push(), pop(), empty()
B) push(), pop(), peek(), empty()
C) peek(), remove(), insert()
D) peek(), insert(), isEmpty()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
17
The Java API includes a Stack class as part of the package java.util. This class is declared as follows:

A) public class Stack<E> implements Vector<E>
B) public class Stack<E> extends List<E>
C) public class Stack<E> extends Vector<E>
D) public class Stack<E>
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
18
What is value of the following postfix expression?
5 6 1 + *

A) 14
B) 20
C) 30
D) 35
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which of the following is a balanced expression?

A) (a + b * {c [d - e]}) + (d / e )
B) (a + b * {c [d - e])) + (d / e )
C) (a + b * {c [d - e])) + (d / e ]
D) (a + b * {c [d - e])}+ (d / e )
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
20
An alternative to implementing a stack as an extension of Vector is to write a class that has a(n) ____ component.

A) array
B) List
C) Queue
D) tree
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
21
The easiest approach to implementing a stack in Java would be to give it a(n) ____ component for storing the data.

A) LinkedStack
B) ListStack
C) SyntaxErrorException
D) List
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
22
Rewrite the following in infix form: x1 2.5 count * 3 / +

A) x1 * 2.5 / count + 3
B) x1 + 2.5 * count / 3
C) x1 + 2.5 / count * 3
D) x1 * 2.5 + count / 3
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
23
The method ____ returns the position of the character argument in the string.

A) String.indexOf
B) String.index
C) String.charOf
D) String.char
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
24
The storage policy used by a stack is ____.

A) FIFO
B) LIFO
C) LIFFO
D) FIFFO
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
25
The value of the following expression is ____.
5 7 * 3 10 + + 4 /

A) 8
B) 12
C) 20
D) 36
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.