Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 A ( 2 1 Marks ) ( a ) Suppose you have been tasked with designing an algorithm that finds and stores all

Question 1A (21 Marks)(a) Suppose you have been tasked with designing an algorithm that finds and stores all the prime numbers between two arbitrary numbers, N and M, where N < M. Required: (i) State the appropriate data structure you can use to store the prime numbers [1](ii) Justify your choice of data structure in (i) above [2](b) Consider the following words: Brenda, James, Aaron, Andrew, Mukai, Tatenda, Nyabiko, Ntsoaki, Axiel, Bobby Required: (i) Populate a BST using the words above. [5](ii)State with justification whether the tree you drew above is or is not a: a. Complete binary tree [1] b. strictly binary tree [1] c. perfect binary tree [1](iii) Show the order of traversal of the tree using each of the following methods: a. Preorder [2] b. In-order [2] c. Post-order [2] d. Depth-first search [2](iv) Calculate the maximum number of permissible nodes for this tree. [2]

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_2

Step: 3

blur-text-image_3

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

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

demonstrate the importance of induction training.

Answered: 1 week ago