Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sir, Please solve these questions asap Question 1 Suppose you have to design a number calculation system. You need to write a recursive function that

image text in transcribed

image text in transcribed

image text in transcribed

Sir, Please solve these questions asap

Question 1 Suppose you have to design a number calculation system. You need to write a recursive function that will take a 2 dimensional array/ list (in python) of numbers. You need to find the maximum number of the array / list using a recursive function. Implement the following recursive function. [You can not use any loop in the code] Hint: You will need nested recursive functions. [Note for Implementation: You are not allowed to use any built-in functions except len() and print() in Python and any kind of global/class variable). def firstFunctionMax (arr, indexl, index2, max): #To Do return OR public int firstFunctionMax (int[][] arr, int indexl, int index2, int max) { //To Do return } Sample Input Sample Output Explanation 16 [[10, 2, 13], [4, 15, 16], [7, 8, 9]] Here, in the list the maximum number is 16. [[15, 18], [4, 17]] 18 Here, in the list the maximum number is 18. Question 3 A B C D E TI G H I J 1 0 0 0 1 0 0 A 0 1 0 1 0 0 0 0 0 0 B 0 0 1 0 1 0 0 0 0 0 C 0 0 0 0 0 0 1 0 0 0 DO D 0 1 1 0 0 0 0 0 0 0 E 0 0 0 0 0 0 1 1 0 0 00 0 00 0 1 0 | | | | | | | | | | F F 0 0 0 0 0 G 0 0 0 0 G 0 0 0 0 0 1 0 0 0 1 H 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 1 H 00 00 0 1 J 0 00 0 O 0 O 0 0 O 0 0 0 a. Given the above adjacency matrix: i. Draw the equivalent adjacency list. [2] ii. Draw the equivalent graph. [2] iii. Calculate the indegree and outdegree of each vertex of the graph. [1] b. Given the array representation of a binary tree [null value means the node is empty]: [null, A, E, H, D, null, B, F, I, C, null, null, null, G, J, null] i. Draw the binary tree. [2] ii. Write the pre-order and post-order traversal sequence of the tree. [2] iii. Convert the tree to a complete binary tree. [1] Question 2 Given the array (aC@35, bD$74, hX#21, t7%98, k1&3P). [Let, A = 65, B = 66, C = 67, ... Y = 89, Z = 90; a = 97, b = 98, c = 99, ... y = 121, z = 122; @ = 64, # = 35, $ = 36, % = 37, & = 38; 0 = 0, 1 = 1, .... 9 = 9]. a. Draw a hashtable of length 5. Using the hash function f, where f(element) = (summation of the values of the alphabets and symbols - product of the digits % length of the hashtable. Fill up the hashtable using Linear Probing where necessary. [Note: You must show your work for partial credit.] b. Write a function to create an auxiliary array of key index search that takes an array containing the (summation of the values of the alphabets and symbols) of the elements of the array given in part a

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions

Question

2. Discuss various aspects of the training design process.

Answered: 1 week ago

Question

5. Discuss the key roles for training professionals.

Answered: 1 week ago