Question: QUESTION 1: Answer the following multiple subsections about Java: Sorting and Maps. A prerequisite to performing a sort is: a. An ArrayList b. An equals

QUESTION 1: Answer the following multiple subsections about Java: Sorting and Maps.

  1. A prerequisite to performing a sort is: a. An ArrayList b. An equals operator c. A comparison operator d. A linked list

  2. The following pattern could be used in which type of sort: int splitPoint = split(a,begin,end); sort(a, being, splitPoint); sort(a, splitPoint+1, end); join(a, begin, splitPoint, end):

a. bubble

b. selection

c. merge

d. Insertion

  1. When a sorting algorithm is described as stable, that means:

    a. Always takes the same amount of time, regardless of original data ordering b. For duplicate keys, preserves the original order c. Guaranteed to terminate
  2. The Big-O of a binary search over a sorted list is:

    a. log n b. n log n c. n d. n^2
  3. In a map class, the capacity is:

    a. Percentage of buckets that have values b. The buckets in the hash table
  4. In a map class, the load is:

    a. The number of buckets in the hash table b. The percentage of buckets that have values
  5. The main difference between Lists and Sets is:

    a. Only Sets are abstract b. Sets do not allow an element to occur more than once c. Lists have iterators
  6. Rehashing occurs when

    a. A HashMap becomes full and resizes b. A pair is added to a HashMap c. A pair is removed from a HashMap

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!