The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
True/False). We can implemet a stack using linked list because we can add nodes at the front of the list and also remove elements from the list. (You are encouraged to make diagrams to yourself to see the behaviour)
Select one:
 True
 False
Question 2
Not yet answered
Marked out of 1.00
 Flag question
Question text
A linked list can be traversed recursively as well as iteratively. We want to count the number of nodes in a linked list using recursion. Which of the following methods implements this concept? Select the one correct response.
Â
|
I int getCount(int count, LinkedNode current) |
III int getCount(int count, LinkedNode current) |
|
II int getCount(int count, LinkedNode current) |
IV int getCount(int count, LinkedNode current) |
Select one or more:
 a. II
 b. III
 c. IV
 d. I
Question 3
Not yet answered
Marked out of 1.00
 Flag question
Question text
Given tha the variables set1 and set2 are references to two distinct set objects, what is the result of the following operation
set1.add(set2)
Select one:
 a. set2 contains all elements in set1 and set1 combined.
 b. set1 contains all elements in set1 and set2 combined.
 c. set2 remains unchanged
 d. set1 remains unchanged.
Question 4
Not yet answered
Marked out of 1.00
 Flag question
Question text
Select the from the classes below those that help in creating the graphical features of a frame.
Select one or more:
 a. Color.java
 b. Math.java
 c. JFrame.java
 d. JButton.java
 e. Cursor.java
 f. String.java
 g. MenuItem.java
Question 5
Not yet answered
Marked out of 1.00
 Flag question
Question text
True or False. The capacity of a vector and its size are always the same.
Select one:
 True
 False
True or False, the JFrame class requires you to place components on the content pane of the frame, in order for the component to be displayed properly.
Select one:
 True
 False
Question 8
Not yet answered
Marked out of 1.00
 Flag question
Question text
Let the variable list represents a pointer to the head of a linked list of nodes, called LinkedNode; where LinkedNode is defined as follows:
|
class LinkedNode |
Â
A node called temp must be inserted at the front of the list. (where temp is defined as: LinkedNode temp = new LinkedNode(200) )
Which of the following sets of codes best describes the situation. Select the one right response.
|
I LinkedNode current = list; |
II temp.next = list; |
|
III temp = list; |
IV LinkedNode current = list; |
Select one:
 a. IV
 b. II
 c. I
 d. III
Question 9
Not yet answered
Marked out of 1.00
 Flag question
Question text
There are three ways to insert nodes into a linked list. What are these three ways?
Select one or more:
 a. Append to the list
 b. Insert at the bottom.
 c. Insert at the front
 d. Insert back and front
 e. Insert anywhere in the list
Consider the following segment of code. When this segment gets executed, the output is:
import java.util.Stack;
class MyStack
{
:::::::::::
void myStack()
{
Stack s = new Stack();
s.push("P");
s.pop();
s.push("Q");
s.push("R");
s.push(s.peek());
System.out.println(s.toString());
}
}
Select one:
 a. [R, R, Q]
 b. [Q, R]
 c. [Q, R, R]
 d. [P, Q, R]
 e. [P, R, R]
Question 12
Not yet answered
Marked out of 2.00
 Flag question
Question text
|
An object that can refer to objects of its same kind is what kind of object? |
Answer 1Â |
|
The term LIFO refers to the data structure called |
Answer 2Â |
|
A data structure where individual components are joined together by references is a |
Answer 3Â |
|
The term FIFO refers to the data structure called |
Answer 4Â |
|
The end of a list is represented by the object called |
Answer 5Â |
Question 13
Not yet answered
Marked out of 1.00
 Flag question
Question text
Which of the following statements are true about the data structure called stack?
Select one or more:
 a. A stack is an ordered collection of elements, where the elements are added to and remove from the collection at either end called the stack top.
 b. Elements can be added to and remove from any position in the list as long as long as the index is not out of bounds.
 c. A stack is characterized as a last-in, first-out (LIFO) list.
 d. A stack is an ordered collection of elements, where the elements are added to and remove from the collection at the one end called the stack top.
Question 14
Not yet answered
Marked out of 1.00
 Flag question
Question text
Which of the following are the main collection interfaces?
Select one or more:
 a. Set
 b. Vector
 c. List
 d. HashSet
 e. Collection
Consider the following class called LinkedNode that represents a node. If the variable list represents a linked list of these nodes, which of the statements that follows the class definition will traverse the list and print the data in the list?
|
class LinkedNode |
Â
Â
|
I public void print(LinkedNode list) |
II public void print(LinkedNode list) |
|
III public void print(LinkedNode list) |
IV public void print(LinkedNode list) |
Â
Â
Select one or more:
 a. IV
 b. II
 c. III
 d. I
Question 17
Not yet answered
Marked out of 1.00
 Flag question
Question text
True or False. Like an ArrayList, you can add elements at any position in the vector.
Select one:
 True
 False
Question 18
Not yet answered
Marked out of 1.00
 Flag question
Question text
Consider the following postfixed expression:
3 5 * 7 2 - +
When the expression is evaluated, the result is:
Select one:
 a. 10
 b. 28
 c. 0
 d. 31
 e. 20
Question 19
Not yet answered
Marked out of 1.00
 Flag question
Question text
The FlowLayout manager layouts out button to flow NORTH, SOUTH, EAST, WEST, and CENTER.
Select one:
 True
 False
Question 20
Not yet answered
Marked out of 1.00
 Flag question
Question text
Given the following ActionListener
|
public class Actions implements ActionListener |
What line of code can be written at A, that will print the name of the action ( string) taken?
Select one:
 a. System.out.println( getActionCommand() );
 b. System.out.println( e.getCommand() );
 c. System.out.println( e.getActionPerformed() );
 d. System.out.println( e.getActionCommand() );
Question 21
Not yet answered
Marked out of 1.00
 Flag question
Question text
The following class LinkedNode representing a node. If the variable list represents a linked list of these nodes, which of the statements that follows the class definition will traverse the list and print the data in the list?
|
class LinkedNode |
Â
Â
|
I public void print(LinkedNode list) |
II public void print(LinkedNode list) |
|
III public void print(LinkedNode list) |
IV public void print(LinkedNode list) |
Â
Select one:
 a. I
 b. II
 c. III
 d. IV
Question 22
Not yet answered
Marked out of 1.00
 Flag question
Question text
When inserting nodes in a linked list the best method of keeping a sorted list is the method of inserting at the back and the front.
Select one:
 True
 False
Question 23
Not yet answered
Marked out of 1.00
 Flag question
Question text
In order for a menuitem be activated when you click on it, the menuitem must be registered onto a listener object. The listener object that is required is a WindowListener object.
Select one:
 True
 False
-----------