Q3 Design Name: Silly2.0 Input: int x Output: translate x integer into base 2 number and place it into an in an array size log_2(x)+1 for example silly(5) returns A=[1,0,1] What is the runtime of your algorithm in terms of x?

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 19RQ
icon
Related questions
Question

Please solve the following computer science problem: 

show all work/explanation 

Q3 Design
Name: Silly2.0
Input: int x
Output: translate x integer into base 2 number and place it into an in an array size log_2(x)+1
for example silly(5) returns A=[1,0,1]
What is the runtime of your algorithm in terms of x?
Transcribed Image Text:Q3 Design Name: Silly2.0 Input: int x Output: translate x integer into base 2 number and place it into an in an array size log_2(x)+1 for example silly(5) returns A=[1,0,1] What is the runtime of your algorithm in terms of x?
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer