Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1. Suppose you have a list of n encrypted files on your computer and a pass-code to unlock each file (n pass-codes). However, you

image text in transcribed

Problem 1. Suppose you have a list of n encrypted files on your computer and a pass-code to unlock each file (n pass-codes). However, you forgot which pass-code unlocks which file. When you try a pass-code Pito unlock a file FU, the system will output: 1. P[] is a match for Fil 2. Fils match pass-code is smaller than P[] 3. Fu's match pass-code is greater than Pi You have the following limitations: You cannot compare pass-codes against each other. You cannot check if a files pass-code is greater or smaller than another files pass-code. a) Write a randomized algorithm that matches each file to its pass-code which has the expected running time O[n log(n). Write pseudo-code. b) Analyze the running time of your algorithm, and show that the running time has o(n logn)) c) Give an informal proof that your algorithm is correct. (You can give a formal proof if you wish) HINT: think about quicksort Problem 1. Suppose you have a list of n encrypted files on your computer and a pass-code to unlock each file (n pass-codes). However, you forgot which pass-code unlocks which file. When you try a pass-code Pito unlock a file FU, the system will output: 1. P[] is a match for Fil 2. Fils match pass-code is smaller than P[] 3. Fu's match pass-code is greater than Pi You have the following limitations: You cannot compare pass-codes against each other. You cannot check if a files pass-code is greater or smaller than another files pass-code. a) Write a randomized algorithm that matches each file to its pass-code which has the expected running time O[n log(n). Write pseudo-code. b) Analyze the running time of your algorithm, and show that the running time has o(n logn)) c) Give an informal proof that your algorithm is correct. (You can give a formal proof if you wish) HINT: think about quicksort

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

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

10. What is meant by a feed rate?

Answered: 1 week ago