Question

In: Computer Science

Which one ore more of the following statements is/are true of Java? a.LinkedList < T >...

  1. Which one ore more of the following statements is/are true of Java?

a.LinkedList < T > and ArrayList < T > are interfaces
b.List < T > is a concrete class
c.LinkedList < T > and ArrayList< T > are concrete classes
d.List < T > is an interface

  1. Suppose we run these operations on a queue of characters:

enqueue 'a'

enqueue 'b'

enqueue 'c'

dequeue

dequeue

What remains in the queue after these operations complete?

a. 'a'
b. 'a', 'b'
c. 'b', 'c'
d. 'c'

  1. Suppose we run this series of operations on a stack of characters:

push 'a'

push 'b'

pop

peek

push 'c'

pop

What value(s) is/are on the stack after these operations are complete?

a. 'a', 'b', 'c'
b. 'a', 'b'
c. 'c'
d. 'a'

  1. Which of the following lists is *not* ordered from least-expensive complexity to most-expensive complexity?

a. O(1), O(log n), O(n), O(n ^ 2)
b. O(n log n), O(n), O(1), O(log n)
c. O(log n), O(n), O(n log n), O(n ^ 2)
d. O(l), O(n), O(n ^ 2), O(n ^ 3)

  1. Which statement is false?

a. binary search of a sorted array is O(log n)
b. linear search of an array is O(n)
c. traversing a linked list is O(n)
d. adding an element to the end of an arraylist that has available space is O(n)

Solutions

Expert Solution


Related Solutions

A) Which of the following statements are true? Note that there may be more than one...
A) Which of the following statements are true? Note that there may be more than one correct answer; select all that are true. As the p-value increases, the evidence against the null hypothesis also increases. In hypothesis testing, if the p-value is sufficiently small, then the null hypothesis can be rejected in favour of the alternate hypothesis. If the null hypothesis is true, then the p-value will always be greater than 0.1. If the null hypothesis is false, then the...
Which of the following statements are TRUE? Note that there may be more than one correct...
Which of the following statements are TRUE? Note that there may be more than one correct answer; select all that are true. There are countably infinite values of X in a continuous uniform distribution. For a continuous uniform distribution defined on the interval [a,b], P(X < a) and P(X > b) is undefined. The mean and the variance of a continuous uniform random variable are the same. In a continuous uniform distribution, the mean and the median are the same....
Which of the following statements are true (T) and which are false (F)? a. In the...
Which of the following statements are true (T) and which are false (F)? a. In the Fisher’s exact test we test the following hypotheses: H0: the proportions of type A and type B discordant pairs are the same (pA=pB). H1: the proportions of type A and type B discordant pairs are not the same (pA≠pB). b. Using the McNemar’s test to analyze matched-pair data (paired samples) is a correct decision. c. The Fisher’s exact test is based on a 2x2...
1. Which of the following statements are true? Select all that apply. Select one or more:...
1. Which of the following statements are true? Select all that apply. Select one or more: a. Earnings per share is calculated by dividing retained earnings by the number of shares of common stock outstanding. b. The creditors of a firm must be satisfied before any earnings can be distributed to the common shareholders. c. When referring to ratio comparisons, time-series analysis compares a firm to that of an industry leader. d. The operating profit margin must take into account...
Which of the following statements are true Select one: a. Indigenous Australians are 1.7 times more...
Which of the following statements are true Select one: a. Indigenous Australians are 1.7 times more likely than non-indigenous Australians to have a disability b. When indigenous people have heart attacks they are more than twice as likely to die from the heart attacks as a non-indigenous counterparts c. When indigenous people are admitted to hospital following a heart attack there is a 40% lower rate of being investigated by angiographic coronary angioplasty or stent procedures d. The research shows...
Which of the following statements regarding dissociation is true:(might be more than one answer) - is...
Which of the following statements regarding dissociation is true:(might be more than one answer) - is always symptomatic of a dissociative disorder - dissociation can be a symptom of a stress-related disorder - most often affects semantic memory - dissociation often occurs during a traumatic event
Which of the following statements regarding flagella are true? Select one or more: a. Some microbes...
Which of the following statements regarding flagella are true? Select one or more: a. Some microbes contain internal flagella b. Some microbes contain external flagella c. All flagella spin in a circular fashion d. Some microbes contain perpendicular flagella e. Bacterial flagella consist of multiple parts
Read the following 5 statements and decide which of them are TRUE: Select one or more:...
Read the following 5 statements and decide which of them are TRUE: Select one or more: a. An asset is preferred by investors, if it has a higher return compared to another asset, even if the risk is also higher. b. The covariance as well as correlation measure the statistical relationship between two variables and are both symmetric. c. The contribution of an individual asset to the expected return of a portfolio is purely given by the expected return of...
Read the following 5 statements and decide which of them are TRUE: Select one or more:...
Read the following 5 statements and decide which of them are TRUE: Select one or more: a. In the CAPM it is assumed that the relationship between returns and Beta is non-linear. b. The beta of the market portfolio is 1 while the beta of the risk free investment is 0. c. The security market line shows that the expected return of an investment is given by the risk free rate plus a risk premium for its sensitivity to changes...
Which of the following statements are true regarding chemical reactions? T = true and F =...
Which of the following statements are true regarding chemical reactions? T = true and F = false. A) the more negative the ΔG, the further towards completion the reaction will proceed before equilibrium is reached. B) only a system not at equilibrium can perform work. C) for most biochemical reactions in a metabolic pathway, equilibrium is rarely reached. D) in a closed system, a chemical reaction will proceed spontaneously until the reactants and products are in equal concentration.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT