Question: ( 6 points ) Binary data can represent different type of information, the purpose of this question is to help you clarify the difference between

(6 points) Binary data can represent different type of information, the purpose of this
question is to help you clarify the difference between different representation of information.
For this question, explain what does the hexadecimal value 93(i.e.9316) represent in each
case:
(a)(2 points) The decimal value if it is an unsigned number.
(b)(2 points) The decimal value if it is a signed number given in 2's complement repre-
sentation
(c)(2 points) An ASCII character. Hint: you need to consult the extended ASCII ta-
ble which require searching the internet for such table, make sure to give appropriate
reference on the table used (i.e. website link) and a copy of it with your submission
Assignment # 1
Due Oct 3rd,2024
Upload your solution on Moodle
Q1.[5 pts] Consider the problem of adding two n-bit binary integers, stored in two n-element
arrays A and B. The sum of the two integers should be stored in binary form in an (n+1)
element array C. State the problem formally and write an algorithm for adding the two
integers.
Calclulate the time complexity of your algorithm
Q2.[10 pts] Write an algorithm that reverses an array in place. Define a loop
invariant for your algorithm and prove its correctness using the steps of initialization,
maintenance, and termination.
What is the time complexity of your algorithm?
Q3[5pts] Write a recursive algorithm that takes a string as input and returns the
reversed string.
Calculate the time complexity of your algorithm
Q4[5 pts] For each of the following recurrences, give an expression for the runtime T(n) if
the recurrence can be solved with the Master Theorem. Otherwise, indicate that the Master
Theorem does not apply.
T(n)=3T(n2)+n2
T(n)=4T(n2)+n2
T(n)=T(n2)+2n
T(n)=2nT(n2)+nn
T(n)=16T(n4)+n
( 6 points ) Binary data can represent different

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!