Describe the base case of a recursive algorithm

Assignment Help Data Structure & Algorithms
Reference no: EM13930259

1.) You are using a language that does not support recursion. What data structure would you use to traverse a binary search tree in order?
A. Queue
B. List
C. Stack
D. Can't traverse a tree in order without recursion

2.) The data structure that keeps track of activation records during the execution of a program
A. Run-time queue
B. Run-time stack
C. Linked list
D. Heap

3.) Which of the following statements could describe the base case of a recursive algorithm?
A. F(x) = x - F(x - 1)
B. If the array length is 100, do nothing
C. All parameters are integers
D. F(0) = 27
E. B and D above

4.) IntFunc(/*in*/int n)
{
If (n == 5)
Return 5;
Else
Return 2 * Func (n+1);
}
What is the value of the expression Func (2)?

5.) The three-question testing method is based on what computing technique?
A. Top-down design
B. Object-oriented design
C. Induction
D. Divide/conquer
E. Answer not shown

6.) Draw the binary search tree containing the following 11 values in the order shown and answer the question.
15 7 9 21 44 30 33 29 10 1 17 ( in that order).
What level is the value of 17 ( root is level 0)?
A. 0
B. 1
C. 2
D. 3
E. 4

7.) Draw the binary search tree containing the following 11 values in the order shown and answer the question.
15 7 9 21 44 30 33 29 10 1 17 ( in that order).
Which is the inorder successor of 15?
A. 10
B. 9
C. 17
D. 7
E. 44

8.) Draw the binary search tree containing the following 11 values in the order shown and answer the question.
15 7 9 21 44 30 33 29 10 1 17 ( in that order).
How many levels are in the tree?
A. 3
B. 4
C. 5
D. 6
E. Unknown

9.) Draw the binary search tree containing the following 11 values in the order shown and answer the question.
15 7 9 21 44 30 33 29 10 1 17 ( in that order).
Which is the inorder predecessor of 44?

A. 29
B. 30
C. 21
D. 33
E. Unknown

10.) Draw the binary search tree containing the following 11 values in the order shown and answer the question.
15 7 9 21 44 30 33 29 10 1 17 ( in that order).
How many nodes are there on level 2 (root is level 0)?
A. 2
B. 3
C. 4
D. 5
E. Unknown

11.) The value property of heaps says that the value in a node is
A. Greater than the values of its children.
B. Less than the values of its children.
C. Greater than or equal to the values in its children.

12.) ReheapDown restores the heap property after
A. An insertion
B. A deletion

13.) An adjacency matrix is a way of representing
A. Vertices
B. Edges
C. Vertices and edges

14.) A heap must be a full binary tree.
A. True
B. False

15.)Two or more keys that produce the same hash location are called
A. Synonyms
B. Collision
C. Clustering

16.) Radix Sort makes use of which of the following container classes?
A. Stack
B. Queue
C. Dequeue
D. Heap
E. Binary search tree

17.) A bucket (in hashing) is
A. a container for water
B. collection of synonyms
C. clusters

18.) Quick sort is always quick
A. True
B. False

19.) Merge sort requires extra space
A. True
B. False

20.) Which is true?
A. O(1)
B. O(logN)
C.O(N)
D. O(N*N)

Reference no: EM13930259

Questions Cloud

Profitable business operating within an attractive market : The Steel Tube division was a profitable business operating within an attractive market. The investment, which employed new technology, had recently been identified as part of the group's core activities.
Name and describe the two categories of internal controls : What is the purpose of internal controls?
Conduct a survey of your fellow colleagues to gauge : Question 1: You have been asked to conduct a survey of your fellow colleagues to gauge their use of social media at the work place. Explain the following:
What procedures could be put into place to prevent : What do you suppose caused the discrepancy between the actual count and the count that Rhonda had supplied?
Describe the base case of a recursive algorithm : Which of the following statements could describe the base case of a recursive algorithm? You are using a language that does not support recursion. What data structure would you use to traverse a binary search tree in order
Classifications and descriptions information to enter record : Use the Job classifications and descriptions information to enter records into the Job Title table for the following titles:
Adjusting entry for the nsf check and the subsequent entry : Record in general journal form the adjusting entry for the NSF check and the subsequent entry for redemption of the check by the customer.
Message on the recorded answering machine : At 4.30pm on Monday, Alex reads Michael's acceptance and immediately telephones Joshua's business address, leaving a message on the recorded answering machine: "Ignore the letter you will receive-deal off. Alex."
Polar coordinate system and rectangular coordinate : The rectangular coordinates of a point in the x-y plane are (??,??)=(2.75, -6.10). Draw this point and label the axes and the point appropriately. Then find the polar coordinates of this point. Convert (??,??)=(8.44mm, 23°) to Cartesian coordinat..

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Write algorithm using pseudocode to recognize substrings

Write the algorithm, using pseudocode, to do the following task, Given the string of numbers, recognize all the substrings which form numbers which are divisible by 3.

  Insertion sort and merged using standard merging mechanism

Using "insertion sort" and then merged using standard merging mechanism, where k is value to be determined. How must be we select k in practice?

  Can you find the element of an array

We would like to determine whether a given array A has a majority element, and if so, find the element.

  Write a procedure hamming

Write a procedure hamming(ascii, encoded) that converts the low-order 7 bits of ascii into an 11-bit integer codeword stored in encoded.

  Find the first occurrence, the last occurrence

If numbers in a list aren't unique and therefore the largest number could occur more than once would the algorithm find the first occurrence, the last occurance? Every occurance?

  Write algorithm that allows the customer to enter amount

An ATM allows a customer to withdraw a maximum of $500 per day. If a customer withdraws more than $300, the service charge is 4% of the amount over $300.

  Data structures assignment requiring c++ program

You should build enough new roads such that if City A was reachable from City B via some old roads, City A must be reachable from City B via some new roads.

  Sort the objects use one sorting algorithm

Sort the objects use one sorting algorithm (e.g. bubble-sort) and write the sorting results back to a file 126export.txt.

  Basic algorithm and pseudocode help

An area is calculated by multiplying the length by the width. The pseudocode program below should ask the user for the length and width of a rectangular room in order to calculate the area, and display the room's area.

  Data systems and design

Suppose if you have a program with a housekeep() module, a mainloop() module, and a finishup() module, when is the second input record usually read?

  Uml graphical notation to define the object classes

Use UML graphical notation, construct the design for the system to define the object classes and show the interaction of the data collection sub systems.

  What are advantages of using linked list instead of a vector

What is the difference between a class template and a template class? What are the advantages and disadvantages of using a linked list instead of a vector?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd