Algorithm and Data Types- Programming Assignment Help

Responsive Centered Red Button

Need Help with this Question or something similar to this? We got you! Just fill out the order form (follow the link below), and your paper will be assigned to an expert to help you ASAP.

Programming Assignment Help:

Task:

Question 1
Consider the following algorithm:
for ( i = 1; i<= 1.5n; i++) print i for ( i = n; i >= 1; i–)
print i
(a) What is the output when n = 2, n = 4?
(b) What is the time complexity?

Question 2

Consider the following algorithm:
int add_them (int n, int A[])
{
int i, j, k;
j = 0;
for ( i = 1; i<= n; i++) j = j + A[i] k = 1; for ( i = 1; i<= n; i++) k = k + k; return j + k; } (a) If n = 5 and the array A contains 2, 5, 3, 7, and 8, what is the output? (b) What is the time complexity of the algorithm? (c) Try to improve the efficiency of the algorithm.

How to create Testimonial Carousel using Bootstrap5

Clients' Reviews about Our Services