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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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