GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

Section 3 – Short Discussion – each should be answered in 4…

Section 3 – Short Discussion – each should be answered in 4 to 7 sentences. (5 points each)

Read Details

Which of the following statements are CORRECT? Check ALL tha…

Which of the following statements are CORRECT? Check ALL that apply.

Read Details

Given the following recursive method, which value for ARG wi…

Given the following recursive method, which value for ARG will give a method which eventually terminates (for all values of n)? public static int recurse(int n) { if (n

Read Details

What is the runtime complexity of the following getMinimum()…

What is the runtime complexity of the following getMinimum() method, assuming that the problem size N is the input parameter size (the number of elements stored in the array data)? /** * Recursive method which returns the minimum element of an oversize array * @param data a non empty oversize array * @param size number of elements stored in an oversize array * @return the minimum element of the oversize array data */ public static int getMinimum(int[] data, int size) { if (size == 1) return data[size-1]; return Math.min(data[size-1], getMinimum(data, size-1)); }

Read Details

Select the correct answer to fill in each of the following b…

Select the correct answer to fill in each of the following blanks. The case where a recursive method does NOT call itself is called the [_BLANK1_].   The case where a recursive method calls itself is called the [_BLANK2_].

Read Details

Which of the following Big-O time complexities corresponds t…

Which of the following Big-O time complexities corresponds to the LEAST efficient algorithm?

Read Details

What is the worst-case runtime complexity of the following …

What is the worst-case runtime complexity of the following  addPassword() method, assuming that the problem size N represents the number of elements stored in the array passwords provided as input? /** * Adds a new password to the end of a list of passwords defined by the oversize array (passwords, size) * @param passwords an oversize array which stores a set of users’ passwords * @param size number of elements stored in the array passwords * @param password to add * @return the new size of the list of users’ passwords after adding a new password */ public static int addPassword(String[] passwords, int size, String password) { for(int i = 0; i < passwords.length; i++) { if(passwords[i] == null) { passwords[i] = password; size++;        break;        } } return size; }

Read Details

Which of the following Big-O time complexities corresponds t…

Which of the following Big-O time complexities corresponds to the MOST efficient algorithm?

Read Details

The government places a price floor on milk (milk).

The government places a price floor on milk (milk).

Read Details

Shoes are an inferior good and your income goes down (shoes)…

Shoes are an inferior good and your income goes down (shoes).

Read Details

Posts pagination

Newer posts 1 … 31,253 31,254 31,255 31,256 31,257 … 88,561 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top