What is a data structure and what do you understand

Assignment Help Computer Engineering
Reference no: EM133339257

Question: Study the following recursive pseudocode algorithm.

FUNCTION Recursive(Num1, Num2 : INTEGER) RETURNS INTEGER
IF Num1 > Num2 THEN
RETURN 10 ELSE
IF Num1 = Num2 THEN
RETURN Num1 ELSE
RETURN Num1 + Recursive(Num1 * 2, Num2)
ENDIF
ENDIF

ENDFUNCTION

(a) The function is called as follows:

Recursive(1, 15)

Dry run the function and complete the trace table. Give the final return value.

Trace table:

Function call

Num1

Num2

Return value

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Final return value

Working

(b) Rewrite the function Recursion() in pseudocode, using an iterative algorithm.

2. What is a data structure?
b) What do you understand by the terms: height of a binary tree and a full binary tree?
c) State two main factors that determine the choice of a data structure for a program ii.)a) Make a BST for the following sequence of numbers. 45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69, 48

b) Traverse the tree in Preorder, Inorder and Postorder.
c) Redraw the BST above after deleting the element 45
iii.) a)A stack operation is given as S.opx(p), where S is a stack, "opx" the operation and "p" the parameter to use.
Show the contents of the stack S after each of the following operations, a.1-a.4have been performed

S.push(2)
S.push(4)
S.push(S.pop()+S.peek())
S.push(S.pop()-S.pop())

b) Using the hash function h(key) = key modulo 9, insert in the order given the keys 5, 29, 20, 0, 27, and 18 into a hash coded table of size 9. Use linear probing to handle collisions.

Reference no: EM133339257

Questions Cloud

Briefly state what is mars model : Briefly state what is MARS model. Do you agree we can predict someone reaction based on understanding his values.
How would you achieve the highest price : If you were assigned the responsibility for selling your firm's products on eBay , how would you achieve the highest price and give five specific ideas
Organizational behavior knowledge helps us to understand : Organizational behavior knowledge helps us to understand, predict and influence organizational events. What is your view of this statement.
Identify at least 4 different stakeholders that operate : Identify at least 4 different stakeholders that operate within the real estate environment in relation to the role they fulfill developer rental agent managing
What is a data structure and what do you understand : What is a data structure and What do you understand by the terms: height of a binary tree and a full binary tree
Analyze the factor of the microenvironment : Analyze the factor of the microenvironment (suppliers, customers, public, competitors) of Trung Nguyen in the US?
Board of trustees about succession planning : How will you educate the Board of Trustees about succession planning? What role should they play in this process?
What do you think india holds a competitive advantage : Do you think India holds a competitive advantage over other countries because all their businesses must have CSR incorporated into them by law for medium
Businesses are started with intention to succeed : Businesses are started with the intention to succeed. In order to do so, an organization must be competitive.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Describe in detail an implementation of a priority queue

Describe in detail an implementation of a priority queue based on a sorted array. Show that this implementation achieves O(1) time for operations min.

  Computes the average of all those numbers

Select minimum number of test cases to achieve 100% statement coverage in ReturnAverage()

  Discuss about encouraging security architecture developments

Briefly respond to all the following questions. Make sure to explain and backup your responses with facts and examples. This assignment should be in APA format.

  What is the difference in the service offered to application

This question is about the service provided by the Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).

  Find minimal expansion of boolean functions

Use K-maps to find a minimal expansion as a Boolean sum of Boolean products of Boolean functions that have as input the binary code for each decimal digit.

  Write a program that prints the number of quarters and dimes

Write a program that prints the number of quarters, dimes, nickels, and pennies that a customer should get back as change.

  How has webcor used technology to support project management

How has Webcor used technology to support project management in the construction field? Describe the main lessons IT managers can learn from Webcor builders.

  How the selected product could be used by your client

Discussion of how the selected product could be used by your client to support its cybersecurity objectives by reducing risk, increasing resistance.

  Design an implementation approach for the database design

design an implementation approach for the database design process to the kelsey elementary school. include

  Describe how footprinting works

By now you are familiar on how FOOTPRINTING works and how it is used to gather information of lost objects like cars or electronics from the above video.

  What are the major disadvantages of c-strings

What are the major disadvantages of C-strings? What are reasons for implementing linked lists in arrays with indices instead of in dynamic memory with pointers?

  Develop a new partitioning function

Using your suggested partitioning algorithm in part (a), come up with a sorting algorithm. Analyze the worst-case running time of your algorithm.

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