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

  Question 1 consider we implement a priority queue as a heap

question 1 consider we implement a priority queue as a heap. suppose the queue has thousands of elements. consider

  Design and develop a linked list

Your first task in developing the application for tracking contributors is to load a list of the people who are helping the cause. Design and develop a linked list, implemented as a stack, to track all of the contributors

  Difference between a problem and an opportunity

What was the problems and/or opportunities facing Delta in late 1997? What is the difference between a problem and an opportunity

  Design adatabase to keep track of all students at university

Discuss how you would design a database to keep track of all students at a university. Explain tables, Primary Keys, Foreign Keys, relationships, attributes, Candidate Keys.

  Find running time of heap sort input sorted-ascending order

Determine the running time of Heap Sort if input is sorted in ascending order. Determine the running time of Heap Sort if input is sorted in descending order.

  Write algorithm by using pseudo code consensus algorithm

Write the algorithm, by using pseudo code, "Consensus algorithm": A group of ten people require to decide which one flavor of ice cream they will all order, out of three options.

  Design and implement an avl tree algorithm

Design and implement an AVL tree algorithm that searches a collection of documents. You will be provided with a set of 50 documents and a set of sample queries. First, you will process the documents and store their content (i.e. words / tokens) in..

  Write adjacency-list representation for complete binary tree

Provide the adjacency-list representation for complete binary tree on 7 vertices. Provide the equivalent adjacency - matrix representation. Suppose that vertices are numbered from 1 to 7 as in binary heap?

  Draw the recursive process of quicksort

Draw the recursive process of Quicksort and Mergesort for sorting the sequence {5, 1, 2, 9, 7}. You will get a recursion tree for Quicksort and Mergesort respectively. What are their depths?

  Create a flowchart using microsoft word

Using given Figure of Exploring Research, create a flowchart using Microsoft Word or a similar program that helps you identify what research design to use for your research question

  Tic tac toe game - design a gui and implement tic tac toe

tic tac toe game - design a gui and implement tic tac toe game in java-implement a random move using two methods

  Create an er diagram

Create an E-R diagram with all appropriate notation for the following condition. In a particular fruit growing region there are a number of orchards.

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