Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Data structures using JAVA final exam

Q1. In a linked list implementation of a stack, only a fixed number of elements can be pushed onto the stack.
a. true
b. false

Q2. In a linked representation, memory for the stack elements is allocated dynamically.
a. true
b. false

Q3. Which of the following must be imported in a program in order to use the Java stack class?
a. java.util
b. stack.util
c. java.stackclass
d. java.classStack

Q4. An array is a random access data structure; a stack is not.
a. true
b. false

Q5. StackClass s = new StackClass(50);
int x, y, z;

s.push(new IntElement(3));
s.push(new IntElement(7));
x = s.pop();
s.push(new IntElement(5));
y = s.pop();
z = s.pop();

Given the sequence of operations above, what is the value of x?
a. 0
b. 3
c. 5
d. 7

Q6. A stack is also called a LIFO data structure.
a. true
b. false

Q7. In a linked list implementation of a stack you must keep track of the address of the top element of the stack.
a. true
b. false

Q8. The operation pop returns the top element of the stack.
a. true
b. false

Q9. The method deleteQueue does which of the following?
a. uses one queue to delete another
b. removes the back element from the queue
c. removes the front element from the queue
d. removes all elements from the queue leaving an empty queue

Q10. Queue can be derived from the class ____.
a. LinkedListClass
b. stack
c. list
d. array

Q11. The method front returns the first element in the queue.
a. true
b. false

Q12. In a queue object, the constructor initializes queueFront and queueRear to indicate that the queue is empty.
a. true
b. false

Q13. FIFO is similar to the way customers in line at a bank are serviced.
a. true
b. false

Q14. In queuing systems, queues of objects are waiting to be served by various ____.
a. operations
b. lists
c. customers
d. servers

Q15. A queue is a set of elements of the same type in which the elements are added at one end and deleted from the other end.
a. true
b. false

Q16. Each iteration of the main loop in the simulation program represents one minute.
a. true
b. false

Q17. In general, if L is a sorted list of size n, to determine whether an element is in L, the binary search makes at most 2 * log2n + 2 key (item) comparisons.
a. true
b. false

Q18. ____ uses a random number generator to find the next available slot.
a. Linear probing
b. Random probing
c. Quadratic probing
d. Chaining

Q19. Data stored in a hash table can be stored in ____.
a. an array only
b. a linked list only
c. a stack only
d. both an array and a linked list

Q20. If the hash function causes a cluster at a particular home position it is known as ____.
a. rehashing
b. primary clustering
c. aggregation
d. secondary clustering

Q21. On average, the number of comparisons made by a sequential search is equal to one-third the size of the list.
a. true
b. false

Q22. One of the disadvantages of chaining is that if the item size is small, a considerable amount of space is wasted.
a. true
b. false

Q23. One requirement of linear search is that the item must be in the array.
a. true
b. false

Q24. In linear search, you search an array starting from the middle component.
a. true
b. false

Q25. If we want to design a search algorithm that is of an order less than log2n, then it ____ be comparison based.
a. must
b. could
c. cannot
d. should

Q26. The worst case for the number of comparisons in quick sort is O(n2).
a. true
b. false

Q27. Suppose that Lis a list of nelements, where n> 0. Let A(n) denote the number of key comparisons in the average case of merge sort. Which of the following is true?
a. A(n) = O(n log2n)
b. A(n) = O(n log n)
c. A(n) = O(n2 log n)
d. A(n) = O(n2 log2n)

Q28. Selection sort always starts with the middle element of the list.
a. true
b. false

Q29. In quick sort the list is partitioned into three sublists, and the three sublists are then sorted and combined into one list in such a way so that the combined list is sorted.
a. true
b. false

Q30. Empirically, heap sort usually takes twice as long as quick sort.
a. true
b. false

Q31. The functions implementing sorting algorithms are included as private members of the related class.
a. true
b. false

Q32. Tracing the execution of a comparison-based algorithm can be done by using a graph called a comparison tree.
a. true
b. false

Q33. Insertion sort tries to reduce the number of key comparisons relative to which of the following?
a. heap sort
b. merge sort
c. selection sort
d. quick sort

Q34. Merge sort uses a pivot just like quick sort.
a. true
b. false

Q35. In an preorder traversal, the binary tree is traversed as follows: 1) Traverse the left subtree, 2) Visit the node, and 3) Traverse the right subtree.
a. true
b. false

Q36. In a binary search tree, the key in the ____ node is larger than every key in the left subtree and smaller than every key in the right subtree.
a. child
b. root
c. right
d. head

Q37. The ____ of a binary tree is the number of nodes on the longest path from the root to a leaf.
a. level
b. height
c. width
d. depth

Q38. A double rotation at a node is a right rotation followed by a left rotation.
a. true
b. false

Q39. There are ____ cases to consider when deleting a node from a binary search tree.
a. two
b. three
c. four
d. five

Q40. In an AVL tree: 1) the height of the left and right subtrees of the root differ by at most 2, and 2) the left and right subtrees of the root are AVL trees.
a. true
b. false

Q41. In a perfectly balanced binary tree ____.
a. the left and right subtrees of the root are binary trees
b. the left and right subtrees of the root have the same depth
c. the left and right subtrees of the root have the same width
d. the left and right subtrees of the root are perfectly balanced binary trees

Q42. Any node in a binary tree can be called a leaf node.
a. true
b. false

Q43. In a breadth first traversal all the nodes at any level, i, are visited before visiting the nodes at level i+ 1.
a. true
b. false

Q44. An edge incident on a single vertex is called a ____.
a. loop
b. map
c. parallel
d. component

Q45. The two most common graph traversal algorithms are the height first traversal and breadth first traversal.
a. true
b. false

Q46. The ____-first traversal of a graph is similar to traversing a binary tree level by level.
a. height
b. depth
c. breadth
d. width

Q47. Graphs can be used to model chemical compounds.
a. true
b. false

Q48. In an undirected graph G = (V, E), the elements of E are ordered pairs.
a. true
b. false

Q49. The second step in a depth first traversal starting at a given node v is to ____.
a. mark the node as visited
b. visit the node
c. go to the vertex u adjacent to v
d. delete the node

Q50. A ____ tree of G is a spanning tree with the minimum weight.
a. minimal spanning
b. short
c. binary
d. binary search

Computer Engineering, Engineering

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

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question suppose that a word of data is transferred from

Question : Suppose that a word of data is transferred from the main memory to the memory buffer register (MBR). However, after decoding the MBR comes to know that it is not the real data rather it is an indirection (poin ...

1 under what circumstances is it advantageous for a company

1. Under what circumstances is it advantageous for a company competing in foreign markets to concentrate its value chain activities in a select few locations? Under what circumstances is it advantageous for a company com ...

Question suppose a wireless channel has a coherence

Question : Suppose a wireless channel has a coherence bandwidth of 100 kHz. What range of bit rates can be supported to have flat fading? The response must be typed, single spaced, must be in times new roman font (size 1 ...

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 ...

Identify at least two 2 factors that have led to the

Identify at least two (2) factors that have led to the explosive growth of digital crime over the past a few decades. Next, describe the most common forms of digital crime, and give your opinion as to why those forms you ...

Suppose you have used the following production function to

Suppose you have used the following Production Function to estimate the Industry's average and marginal products for its inputs: Q = 150 L 1/4 K 1/3  M 1/5. Where Q stands for output; L is labor; K is capital (machine ho ...

Assume you have been selected to build a system for

Assume you have been selected to build a system for Oil&Gas company. Do you prefer to build a win-based system or a web-based system? Why?

Explain the differences between working in the web based

Explain the differences between working in the web based version of Outlook in Office 365 to the desktop application version of Outlook.

A researcher working at a particular company wants to know

A researcher working at a particular company wants to know if workers' health would improve if they were given extra days 'off. In this company, all workers undergo a standard physical exam twice a year and after each ex ...

Question project risk management planpurpose this project

Question: Project: Risk Management Plan Purpose: This project provides an opportunity to apply the competencies gained in the lessons of this course to develop a risk management plan for a fictitious organization to repl ...

  • 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