Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
1 Commented Post
0 Endorsements
~669 People Reached
Favorite Tags
c++ x 1
c x 1
Member Avatar for shamma

What is the time complexity T(n) of the following program? //------------------------------// Question1: ////============/// int n, d, i, j; cin >> n; for (d=1; d<=n; d++) for (i=1; i<=d; i++) for (j=1; j<=n; j += n/10) cout << d << " " << i << " " << j << endl; …

Member Avatar for Rashakil Fol
0
89
Member Avatar for shamma

Suppose you have a computer that requires 1 minute to solve problem instances of size 1000. What instance sizes can be run in 1 minute if you buy a new computer that runs 1000 times faster than the old one, assuming the following time complexities T(n) for our algorithm? (a) …

Member Avatar for jbennet
-1
281
Member Avatar for shamma

Write a linear-time algorithm that sorts n distinct integers, each of which is between 1 and 500. Hint: Use a 500-element array. (Linear-time means your algorithm runs in time c*n + b, where c and b are any constants that do not depend on n. For example, your algorithm can …

Member Avatar for Rashakil Fol
0
71
Member Avatar for shamma

Presently we can solve in our hypothetical machine problem instances of size 100 in 1 minute using algorithm A, which is a O(2n). this is 2 to power n We would like to solve instances of size 200 in 1 minute using algorithm A on a new machine. What is …

Member Avatar for Rashakil Fol
0
59
Member Avatar for shamma

a) Write an algorithm that finds both the smallest and largest numbers in a list of n numbers and calculate its complexity T(n).:-/ b) Write an algorithm that finds both the smallest and largest numbers in a list of n numbers and with complexity T(n) is at most about (1.5)n …

Member Avatar for Lerner
0
75
Member Avatar for shamma

What is the time complexity T(n) of the following portions of code? For simplicity, you may assume that n is a power of 2. That is, n = 2k for some positive integer k. a) … for (i = 1; i <= n; i++) { j = n; cout << …

Member Avatar for Ancient Dragon
0
94