Question: 1. Which code snippet can be used to search a value in the linked list? Select one: A. String searchstring = Tom jones; Person current

1. Which code snippet can be used to search a value in the linked list?

Select one:

A. String searchstring = Tom jones;

Person current = first;

While((not(current.equals(search))&&(current.next == nul))

Current = current.next;

B. String searchstring = Tom jones;

Person current = first;

While((not(current.equals(searchstring)))

Current = current.next;

C. String searchstring = Larry jones;

Person current = first;

While((not(current.equals(searchstring))&&(current.next! = null))

Current = current.next;

D. String searchstring = Tom jones;

Person current = first;

While((not(current.equals(searchstring)&&(current.next! = null))

Current = current.next;

2. Which can be used to create a Linked Data Structure?

a. Public class Node

{

Private String info;

Private next Node;

}

b. Public class person

{

Private String name;

Private String address;

Private string person;

//whatever else

}

c. Public class person

{

Private String name;

Private String address;

Private note next; // a link to another Person object

//whatever else

}

d. Public class Node

{

Private String info;

Private node next;

}

3. Which one of following is not true about Linked Structures?

Select one:

a. Object reference variable hold the address of an object

b. Linked Structures uses a one big contiguous block of memory

c. Series of object make up linked list

d. Linked structure uses object references to create links between object.

4. What is the complexity of isEmpty(), size(), and toString methods for Array stack?

Select one:

a. Size() = O(1)

isEmpty()= O(N)

toString() = O(N)

b. Size() = O(N)

isEmpty()= O(1)

toString() = O(N)

c. Size() = O(1)

isEmpty()= O(1)

toString() = O(1)

d. Size() = O(1)

isEmpty()= O(1)

toString() = O(N)

5. What does the following code do?

String searchstring = Tom Jones

Person current = first;

While ((not(current.equals(Tom))&&(current.next! = null))

Current = current.next;

a. Print Tom jones when found in the list

b. Stop when the search -string is found

c. Stop when the string Tom is found

d. Traverse the whole list and print Tom

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!