Evaluate the worst case running time of the following algorithm in Big-O notation in terms of the variable n. Must justi

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Evaluate the worst case running time of the following algorithm in Big-O notation in terms of the variable n. Must justi

Post by answerhappygod »

Evaluate the worst case running time of the following algorithm
in Big-O notation in terms of the variable n. Must justify your
answers.
Evaluate The Worst Case Running Time Of The Following Algorithm In Big O Notation In Terms Of The Variable N Must Justi 1
Evaluate The Worst Case Running Time Of The Following Algorithm In Big O Notation In Terms Of The Variable N Must Justi 1 (14.37 KiB) Viewed 45 times
Evaluate The Worst Case Running Time Of The Following Algorithm In Big O Notation In Terms Of The Variable N Must Justi 2
Evaluate The Worst Case Running Time Of The Following Algorithm In Big O Notation In Terms Of The Variable N Must Justi 2 (6.9 KiB) Viewed 45 times
(1) public stitic void main(String[] args) { int sum = 0; int n; for(int i=0; i < 99; i++) { for(int j= 1; j<n; j++){ sum++; } } } (11) public static void main(String[] args) { int n; for(int i=0; i<n* n; i++) for(int i=0; j <i; j++) for(int k=0; k< 10000000000000000; k++) System.out.println(i+j+k): } (111) public void int Q3(int n) { int k = 0; sum = 0; while (k <n) { for(int i=n; i > 0:i--) { for(int i=1; j <i;j++){ sum += 1; } } k=k+ 1; } }

(iv) public void Q4(int n) { int k = 0; for(int i=0; i<n; i++) { k=methodi(i): System.out.print(k): } } public stitic int methodi(int i) { int m=0: for(int i=0; i<j;i++) m++; retrun m; }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply