GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

Suppose you push integer elements 1,2,3,4 onto a stack in th…

Suppose you push integer elements 1,2,3,4 onto a stack in that order. Then pop an element off the stack and add that element to a queue. You repeat that process three more times. In what order will you remove the elements from the queue?

Read Details

Selection sort has O(n2) complexity. If a computer can sort…

Selection sort has O(n2) complexity. If a computer can sort 1,000 elements in 4 seconds, approximately how many seconds will it take the computer to sort 1,000 times that many, or 1,000,000 elements?

Read Details

What is the preferred way to implement event listeners?

What is the preferred way to implement event listeners?

Read Details

Another name for linear search is ____ search.

Another name for linear search is ____ search.

Read Details

Which of the following statements about white space in Java…

Which of the following statements about white space in Java is correct?

Read Details

Insert the missing code in the following code fragment. This…

Insert the missing code in the following code fragment. This fragment is intended to read all words from a text file named dataIn.txt. File inputFile = new File(“dataIn.txt”); Scanner in = new Scanner(inputFile); while (____________) { String input = in.next(); System.out.println(input); }

Read Details

Which of the sorts in the textbook can be characterized by t…

Which of the sorts in the textbook can be characterized by the fact that even in the worst case the running time will be O(n log(n)))? I     quicksort II    selection sort III   merge sort

Read Details

Insert the missing code in the following code fragment. This…

Insert the missing code in the following code fragment. This fragment is intended to read all words from a text file named dataIn.txt. File inputFile = new File(“dataIn.txt”); Scanner in = new Scanner(inputFile); while (____________) { String input = in.next(); System.out.println(input); }

Read Details

Consider the following class: public class Stock implements…

Consider the following class: public class Stock implements Comparable { private String name; private double price; // other methods go here public int compareTo(Object otherObject) { Stock otherStock = (Stock) otherObject; __________________________________; } } Which is the best statement to use to complete the compareTo() method?

Read Details

Consider the following code snippet: public class Motorcycle…

Consider the following code snippet: public class Motorcycle extends Vehicle { private String model; . . . public Motorcycle(int numberAxles, String modelName) { model = modelName; super(numberAxles); } } What does this code do?

Read Details

Posts pagination

Newer posts 1 … 76,758 76,759 76,760 76,761 76,762 … 82,040 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top