Question
Asked Jan 25, 2020
27 views

Please answer as soon as posibble. 

Time complexity of the following loop 2
1.
count = 1
while count < 100:
print(count)
count *= 2
O( n)
a)
O( n^2)
b)
O(log n)
c)
O(Vn)
d)
help_outline

Image Transcriptionclose

Time complexity of the following loop 2 1. count = 1 while count < 100: print(count) count *= 2 O( n) a) O( n^2) b) O(log n) c) O(Vn) d)

fullscreen
The number of characters in “x" and the value of "y" for this program:
x = '1'
for i in range(0, 30):
%3D
while j < len (x):
while k < len(x) and x[k]
y += str(k-j) +
j = k
x[j]: k += 1
=D%3D
x[j]
y
a) 30, 0
b) 900, null
c) 5808, (space)
d) 5808,(new line)
help_outline

Image Transcriptionclose

The number of characters in “x" and the value of "y" for this program: x = '1' for i in range(0, 30): %3D while j < len (x): while k < len(x) and x[k] y += str(k-j) + j = k x[j]: k += 1 =D%3D x[j] y a) 30, 0 b) 900, null c) 5808, (space) d) 5808,(new line)

fullscreen
check_circle

Expert Answer

Step 1

For the first question, the correct option would be (C), that is, O(log­2 n).

Reason – If the variable of the loop is multiplied or divided by the constant value, then the time complexity of the lo...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Coding Theory

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: Which of the following are types of isolation zones? (Choose all that apply) Group of answer choice...

A: Types of isolation zones:Device present the server isolation zones restrict those devices which are ...

question_answer

Q: What is the "WHERE statment" in the query attached?

A: Difference between where and having clause:Both WHERE and HAVING clauses are used to filter the data...

question_answer

Q: Internet Protocol, also known as IP, is a best effort protocol. Explain what this means. Why is it t...

A: Internet Protocol: - It is a protocol that is used for routing and addressing data packets so they c...

question_answer

Q: I need help with the following Python 3 program: Given a distance (in kilometers) and a finish time ...

A: The below given python program will obey the following rubrics:Importing essential header files.Disp...

question_answer

Q: Which type of cryptography provides the most security? Group of answer choices Digital signature cr...

A: Answer:Option D: Asymmetric cryptography

question_answer

Q: A contact list is a place where you can store a specific contact with other associated information s...

A: The below given C++ program will obey the following rubrics:Importing essential header files.Definin...

question_answer

Q: (1) Prompt the user for a title for data. Output the title. Ex: Enter a title for the data: Number o...

A: Answer:1.Program: #include &lt;iostream&gt;#include &lt;string&gt; using namespace std; int main(){ ...

question_answer

Q: 7. PersonData and CustomerData classesDesign a class named PersonData with the following member vari...

A: The C++ program and the approach are given below:

question_answer

Q: In a computer instruction format, the instruction length is 10 bits and the size of an addressfield ...

A:  Total number of instructions =210=1024Size of address field=3 bitsAnd the instruction length is 10 ...