Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

Scenario you have been asked to setup a lvm volume for the

Scenario: You have been asked to setup a LVM volume for the Sales group. Your task is to use /dev/sdb to create a logical volume named sales_lvm, format it with XFS, and mount under /sales. Make sure the sales group owns ...

If unemployment rate is 55 and underemployed unemployed and

If unemployment rate is 5.5% and underemployed, unemployed and discouraged workers is 8.4%. What is % of underemployed and discouraged. Is it as easy as just 8.4-5.5?

Assignmentthe smurfware smurfscanner is a new biometric

Assignment The SmurfWare SmurfScanner is a new biometric authentication device to keep non-Smurfs out of the Smurfland network. The biometric device is being dubbed the SmurfScanner by Papa Smurf. The SmurfScanner is a h ...

Question a sparse matrix is an ordered array list of term

Question : A sparse matrix is an ordered array list of Term objects where a Term object consists of a row index, a column index and an Arithmetic object. Write pseudo code for an algorithm to convert an array list of Ter ...

Should we be renegotiating nafta yes or no if it is

Should we be renegotiating NAFTA? yes or no? If it is renegotiated, should it be replaced? What reasons would make it better in your point of view? What is the best argument you can make why NAFTA should or should not be ...

The toronto blue jays raises ticket prices from 100 to 120

The Toronto Blue Jays raises ticket prices from $100 to $120 per seat and experience a decline in ticket sales from 12000 to 10000 per game. i) What is the elasticity of demand for tickets? ii) Assuming the marginal cost ...

Question the states of california arizona new mexico utah

Question : The States of California, Arizona, New Mexico, Utah, and Nevada each send a team of 6 delegates to the Sounth Western States annual conference. A sub commitee of 9 is to be formed to discuss water rights. How ...

Question critical infrastructures -1discuss cybersecurity

Question: Critical Infrastructures - 1. Discuss cybersecurity policy issues affecting SCADA and ICS systems for Critical Infrastructure services for the public, and compare those issues to the policy issues that affect t ...

Task design a smart system facilitated by internet of

Task: Design a smart system facilitated by Internet of Everything. Topic: Smart Homes for The Elderly 1. Develop Operational Concept A. Vision What is the problem, deficiencies or opportunities? State how the need(s) for ...

Quality management plan it should includea short statement

Quality Management Plan. It should include: A short statement that reflects your team's philosophy or objective for ensuring that you deliver a quality system to your client. Develop and describe the following that your ...

  • 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