Two friends are exchanging messages through regular post mail. They don't wan anyone to understand their messages in case anyone read them. The messages the form of an array of characters, where each character has a numeric value as ill k un t

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Question 1 (35 marks)
Two friends are exchanging messages through regular post mail. They don't want
anyone to understand their messages in case anyone read them. The messages are in
the form of an array of characters, where each character has a numeric value as
illustrated in the below lookup table.
A
В
D
E
F
G
H
J
K
M
2 3 4
10 11 12 13
1
7
8
N
PQR
S
TU
V w X
Y
14 15 16 | 17 18 19 20 21 22 23 24 25 26
They decided to change the characters in the array in a way that cannot be observed by
any accidental reading. They do so as follows:
1- Given the original message, for example:
GREETINGS
2- transform the original character to its numeric value
7 18 5 5 20 9 14 7 19
3- For each number, subtracting from its value the value of the first lower value
character after it, and if there's no such character they will keep that character
without any change.
2 13 5 5 11 2 7 7
19
7 18 5 5 20 9 14 7 19
2 13 5 5 11277 19
7 18 55 20 9 14 7 19
7-5 = 2
7 18 55 20 9 14 7 19
18-5 = 13
7 18 55 20 9 14 7 19
No smaller after it
Explanation
Step by step
7 18 5 5 20 9 14 7 19
No smaller after it
7 18 5 5 20 9)14 7 19
20-9 =11
7 18 5 5 20 9 14 (7 19
9-7 = 2
7 18 5 5 20 9 (14 7 19
14-7 = 7
7 18 5 5 20 9 14 7 19
No smaller after it
7 18 5 5 20 9 14 7 19
No smaller after it
4- Return the corresponding character for each new numeric value
в м Е Е К в G G S
Page 2 of 5
a) Using a brute-force approach, design an algorithm to solve
this problem, and analyze its complexity
b) Implement your algorithm using Python
c) Design a more efficient algorithm to solve this problem,
and analyze its complexity [Hint: you can use any data-structure]
d) Prepare a brief report (250 words) comparing the two algorithms
(4+4 marks)
(10 marks)
(8+4 marks)
(5 marks)
Transcribed Image Text:Question 1 (35 marks) Two friends are exchanging messages through regular post mail. They don't want anyone to understand their messages in case anyone read them. The messages are in the form of an array of characters, where each character has a numeric value as illustrated in the below lookup table. A В D E F G H J K M 2 3 4 10 11 12 13 1 7 8 N PQR S TU V w X Y 14 15 16 | 17 18 19 20 21 22 23 24 25 26 They decided to change the characters in the array in a way that cannot be observed by any accidental reading. They do so as follows: 1- Given the original message, for example: GREETINGS 2- transform the original character to its numeric value 7 18 5 5 20 9 14 7 19 3- For each number, subtracting from its value the value of the first lower value character after it, and if there's no such character they will keep that character without any change. 2 13 5 5 11 2 7 7 19 7 18 5 5 20 9 14 7 19 2 13 5 5 11277 19 7 18 55 20 9 14 7 19 7-5 = 2 7 18 55 20 9 14 7 19 18-5 = 13 7 18 55 20 9 14 7 19 No smaller after it Explanation Step by step 7 18 5 5 20 9 14 7 19 No smaller after it 7 18 5 5 20 9)14 7 19 20-9 =11 7 18 5 5 20 9 14 (7 19 9-7 = 2 7 18 5 5 20 9 (14 7 19 14-7 = 7 7 18 5 5 20 9 14 7 19 No smaller after it 7 18 5 5 20 9 14 7 19 No smaller after it 4- Return the corresponding character for each new numeric value в м Е Е К в G G S Page 2 of 5 a) Using a brute-force approach, design an algorithm to solve this problem, and analyze its complexity b) Implement your algorithm using Python c) Design a more efficient algorithm to solve this problem, and analyze its complexity [Hint: you can use any data-structure] d) Prepare a brief report (250 words) comparing the two algorithms (4+4 marks) (10 marks) (8+4 marks) (5 marks)
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education