Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduce 1 0 0 0 0 0 ( N ) integers / floats randomly and save them in a vector / array . Find the

Introduce 100000(N) integers/floats randomly and save them in a vector/array. Find the 100 smallest elements using the following implementations.Record the execution time among 6 different number rages (ex: numbers ranges fit into int, long int, long long int. float. double, long double)1. Implement a Priority Queue implemented by the following different approaches.Print the 100 smallest elements using a. Heap using array/vector b. Heap using binary tree (a heap constructed by tree nodes. (do not use linked list to construct a heap, you will get zero). You are required to implement the following functions insert and delMax for priority queue, of course, also including swim and sink functions (again, node based. Additionally, for the heap using binary tree, you are required to implement the followingfunctions: i. A computeHeight function for heap binary tree that will return the height of the tree. ii. A computeLeaves function for heap binary tree will return the number of leaves of the tree. iii. A lookup(int key) function for heap binary tree that will return true if key is found in the tree and return false otherwise. iv. A sameLevel(Node* current) function that will return all the node pointers at the same level of current node v. A descendant(Node* current, Node* aNode) function that return true if aNode is current nodes descendant node. Otherwise, return false.Use Word or Excel format to presents the results of 6 algorithms, each is executed 5 times record average time (in a graph). State your conclusion of the findings along with the graphs If possible write all the code for this project along with the word format

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

Mysql Examples Explanations Explain Examples

Authors: Harry Baker ,Ray Yao

1st Edition

B0CQK9RN2J, 979-8872176237

More Books

Students also viewed these Databases questions