ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 06 May 2017 My Price 11.00

creating the graphical features of a frame

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)
{
if (current == null)
return count;
else
{
count++;
return getCount(count, current);
}
}

III

int getCount(int count, LinkedNode current)
{
while(current != null)
return count;
else
{
do{
count++;
while(current != null);
}
}

II

int getCount(int count, LinkedNode current)
{
if (current == null)
return count;
else
{
current = current.next;
count++;
return getCount(count, current);
}
}

IV

int getCount(int count, LinkedNode current)
{
if (current == null)
return count;
else
{
current = current.next;
return count + getCount(count, 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
{
int data;
LinkedNode next;
LinkedNode(int i)
{
data = i;
next = null;
}
}

 

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;
whiile(current != null)
current = temp;

II

temp.next = list;
list = temp;

III

temp = list;
list = temp;

IV

LinkedNode current = list;
whiile(current.next != null)
current = temp;

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
{
int data;
LinkedNode next;
LinkedNode(int i)
{
data = i;
next = null;
}
}

 

 

I

public void print(LinkedNode list)
{
LinkedNode current = list;

while (current.next != null)
{ 
System.out.println(current.data);
current = current.next;
}
}

II

public void print(LinkedNode list)
{
LinkedNode current = list;

while (current != null)
{ 
System.out.println(current.next);
current = current.next;
}
}

III

public void print(LinkedNode list)
{
LinkedNode current = list;

while (current != null)
{ 
System.out.println(current.data);
current = current.next;
}
}

IV

public void print(LinkedNode list)
{
LinkedNode current = list;

while (current != null)
{ 
System.out.println(current.data);
current++;
}
}

 

 

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
{
public void actionPerformed(ActionEvent e)
{
// A
}
}

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
{
int data;
LinkedNode next;
LinkedNode(int i)
{
data = i;
next = null;
}
}

 

 

I

public void print(LinkedNode list)
{
LinkedNode current = list;

while (current.next != null)
{ 
System.out.println(current.data);
current = current.next;
}
}

II

public void print(LinkedNode list)
{
LinkedNode current = list;

while (current != null)
{ 
System.out.println(current.next);
current = current.next;
}
}

III

public void print(LinkedNode list)
{
LinkedNode current = list;

while (current != null)
{ 
System.out.println(current.data);
current = current.next;
}
}

IV

public void print(LinkedNode list)
{
LinkedNode current = list;

while (current != null)
{ 
System.out.println(current.data);
current++;
}
}

 

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

Answers

(11)
Status NEW Posted 06 May 2017 04:05 AM My Price 11.00

-----------

Attachments

file 1494045431-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)