Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming 2 - Algorithm Analysis Q1 Algorithm Design (Please use detail) DungeonGator is a repository containing n*m books, each of which has a title length

Programming 2 - Algorithm Analysis Q1 Algorithm Design (Please use detail)

DungeonGator is a repository containing n*m books, each of which has a title length of at most t characters. All the books are stored in a 2-D container or collection, A[n][m] which has n rows and m columns. Each slot in the container contains a random book title. Thus the collection is not sorted and is purely random.

For example,

A[n][m] 0 ... m-1

0 pride and prejudice ... don quixote .

. . . . . . .

n-1 the great gatsby ... ulysses

Write a function using pseudocode or C++ code that takes in as input this repository and returns a new 1-D container with unique book titles. The returned repository must keep one copy of multiple repeated book titles. Note: You can assume that the input collection or container is a 2-D array. Other containers like vectors or lists are fine as long as you state what you are using.

Q2 Algorithm Analysis: (Please explain in detail)

Points Describe and justify the worst-case time and space complexity of your designed algorithm (the one you wrote in Q.1) in Big O notation.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions