Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

do question 5 1. Solve the tollowing time complexity problems. a) Show that: 3x3+x2logx+2x2+3logxO(x3) b) Show that: 2x2+(logx)2+logx+8(x2) (Average time complexity) 2. Write a pseudo

do question 5 image text in transcribed
1. Solve the tollowing time complexity problems. a) Show that: 3x3+x2logx+2x2+3logxO(x3) b) Show that: 2x2+(logx)2+logx+8(x2) (Average time complexity) 2. Write a pseudo code for finding two smallest numbers in a list of positive integers. Trace your code for a small list with at least 4 integers. 3. Find the worst-case time complexity (big-O) for the following codes: a) fori=1ton1forj2i+1to2n1comparisonoperation b) \begin{tabular}{l} for i=1 to n1 \\ for j=1 to m+1 \\ for k=1 to t \\ comp operation \\ for l=1 to n \\ multiplication operation \\ \hline \end{tabular} 4. Write a pseudocode for the following: a) An algorithm that takes n integers and defines if number of negative integers is larger than positive integers in the list. b) A recursive code for exponentiation: ab 5. Find GCD(323,124). Also, find " s " and " t " s. t. GSD(323,124)=s323+t124 (2nd part has bonus mark)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions