Ask Computer Engineering Expert

Data structures using JAVA mid term

Q1. Software engineers typically break the software development process into the following four phases: analysis, ____, implementation, testing and debugging.
a. design
b. requirements gathering
c. white box analysis
d. algorithm analysis

Q2. Which of the following functions g(n) has a constant growth rate?
a. n
b. n2
c. n log n
d. 1

Q3. A(n) ____ is a step-by-step problem-solving process in which a solution is arrived at in a finite amount of time.
a. design plan
b. algorithm
c. process plan
d. structured program

Q4. In the ____ process, the program is modified to fix the (identified) problems or to enhance it.
a. software life cycle
b. implementation
c. software maintenance
d. testing

Q5. In ____ copying, each reference variable refers to its own object.
a. shallow
b. deep
c. method
d. object

Q6. The three fundamental stages a program goes through are: implementation, use, and maintenance.
a. true
b. false

Q7. Encapsulation is the ability to handle data and operations as separate units.
a. true
b. false

Q8. Finalizers are value-returning methods that return the final value of a variable.
a. true
b. false

Q9. Software engineers typically break the software development process into the following four phases: analysis, design, implementation, testing, and debugging.
a. true
b. false

Q10. Polymorphism is the ability to use the same expression to denote different operations.
a. true
b. false

Q11. A checked exception is any exception checked for by the programmer.
a. true
b. false

Q12. If there are three classes, Shape, Circle and Square, what is the most likely relationship between them?
a. Square is a superclass, and shape and circle are subclasses of Square.
b. Shape is a superclass, and circle and square are subclasses of Shape.
c. Shape, circle and square are all sibling classes.
d. These three classes cannot be related.

Q13. Inheritance is an example of what type of relationship?
a. is-a
b. has-a
c. was-a
d. had-a

Q14. An abstract method ____.
a. is any method in the abstract class
b. cannot be inherited
c. has no body
d. is found in a subclass and overrides methods in a superclass using the reserved word abstract

Q15. If you have created an exception class, you can define other exception classes extending the definition of the exception class you created.
a. true
b. false

Q16. Any new class you create from an existing class is called a(n) ____.
a. base class
b. superclass
c. derived class
d. extended class

Q17. To determine whether a reference variable that points to an object is of a particular class type, Java provides the operator instanceof.
a. true
b. false

Q18. The class Throwable is derived from the class Exception.
a. true
b. false

Q19. An abstract class ____.
a. does not have any subclasses
b. is a superclass with many subclasses
c. cannot be instantiated
d. is the base class of all other classes

Q20. An abstract class can define ____.
a. only abstract methods
b. only non-abstract methods
c. abstract and non-abstract methods
d. only abstract instance variables

Q21. What does the following statement do: Vector thisVector = new Vector();
a. Creates an empty vector
b. Creates a vector with 10 elements
c. This statement does not do anything
d. Creates an array

Q22. A list is a collection of elements of the same type.
a. true
b. false

Q23. The method remove for unordered lists uses which combination of methods to remove an item from the list?
a. seqSearch and removeAt
b. removeAt and replaceAt
c. retrieveAt and removeAt
d. seqSearch and replaceAt

Q24. The elements of an object of the class UnorderedArrayList are always sorted.
a. true
b. false

Q25. Which method would you most likely use to add an element to an end of a vector?
a. insertElementAt
b. addElement
c. copyInto
d. lastElement

Q26. The method clone in the class Vector returns a copy of the vector.
a. true
b. false

Q27. A list is full if length is equal to maxSize.
a. true
b. false

Q28. The method ____ removes the elements from the list, leaving it empty.
a. deleteElements
b. removeAt
c. clearList
d. deleteList

Q29. The class ArrayListClass is the subclass of the classes that implement a list.
a. true
b. false

Q30. Which of the following methods requires the shifting of elements?
a. replaceAt
b. retrieveAt
c. insertEnd
d. insertAt

Q31. In an ordered list, we need to modify the algorithms (from a normal linked list) to implement the search, insert, and delete operations.
a. true
b. false

Q32. Searching, inserting, and deleting require traversal of the linked list.
a. true
b. false

Q33. What is the time-complexity to insert an item at the end of a linked list?
a. O(1)
b. O(n)
c. O(n2)
d. O(log n)

Q34. What is the time-complexity of the LinkedListClass copy constructor?
a. O(1)
b. O(n)
c. O(n2)
d. O(log n)

Q35. Building a linked list forward places the new item to be added at the beginning of the linked list.
a. true
b. false

Q36. To delete a given item from an ordered linked list, there is no need to search the list to see whether the item to be deleted is in the list.
a. true
b. false

Q37. In the class LinkedListClass, the search method is declared as ____.
a. public
b. private
c. abstract
d. protected

Q38. By using one reference variable to insert an item into a linked list, the order of the sequence of events is irrelevant.
a. true
b. false

Q39. In an ordered linked list the search algorithm is somewhat improved because the list is ____.
a. larger
b. smaller
c. higher
d. sorted

Q40. In a doubly linked list, some of the operations require modification from how they were implemented for a regular linked list, because of the ____ reference variable(s) in each node.
a. null
b. two
c. three
d. four

Q41. public static int rFibNum(int a, int b, int n)
{
if(n == 1)
return a;
else if(n == 2)
return b;
else
return rFibNum(a, b, n - 1) + rFibNum(a, b, n - 2);
}

What is the limiting condition of the code above?
a. n >= 0
b. a >= 1
c. b >= 1
d. n >= 1

Q42. The body of a recursive method contains a statement that causes the same method to execute before completing the current call.
a. true
b. false

Q43. The overhead associated with iterative methods is greater in terms of both memory space and computer time, when compared to the overhead associated with executing recursive methods.
a. true
b. false

Q44. public static int exampleRecursion (int n)
{
if (n==0)
return 0;
else
return exampleRecursion(n-1) + n*n*n;
}

How many base cases are in the code above?
a. 0
b. 1
c. 2
d. 3

Q45. The general case is the case for which the solution is obtained directly.
a. true
b. false

Q46. A recursive method in which the first statement executed is a recursive call is called a tail recursive method.
a. true
b. false

Q47. Recursive algorithms are implemented using while loops.
a. true
b. false

Q48. private int func1(int m, int n) {
if (m==n || n==1)
return 1;
else
return func1(m-1,n-1) + n*func1(m-1,n);
}

Which of the following would be an invalid call to the method above?
a. func1(0, 1)
b. func1(1, 0)
c. func1(4, 9)
d. func1(99999, 99999)

Q49. There are two base cases in the recursive implementation of generating a Fibonacci sequence.
a. true
b. false

Q50. private int func2(int m, int n) {
if (n == 0)
return 0;
else
return m + func2(m, n-1);
}

What is the limiting condition of the code above?
a. n >= 0
b. m > n
c. m >= 0
d. n > m

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92079648
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As