0% found this document useful (0 votes)
95 views2 pages

Cou3306 Saq 02

Uploaded by

Sayumi Rashmila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views2 pages

Cou3306 Saq 02

Uploaded by

Sayumi Rashmila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

123585511

COU3306 – Data Structures and Algorithm


Self Assignment 02

01. Why is it important to analyze the efficiency of an algorithm ?

Looking at how much space (or memory) an algorithm needs (space complexity)
Looking at how much time it takes to finish a task (time complexity)

02. What is space complexity and why is it significant?

When memory was expensive we focused on making programs as space efficient


as possible and developed schemes to making memory appear lager that it really
was
It was significant because of it how much memory is needed for task completion
under the worst – case scenario .

03. What does the time complexity of an algorithm refer to

Its refers to the total time taken for a program to run until it completes its task.
And this is estimate by counting the number of basic steps performed by the
algorithm during execution.

04. Name three factors, other than input size, that influence the time complexity of an
algorithm.

The size and nature of the input data


The quality of code produced by the compiler used to create the program
The nature and speed of the instruction executed by the machine .

05. Why is the concept of growth rate important in analyzing algorithms?

Because it allows comparing the running time of two algorithms without actually
writing two programs and running them on the same computer

06. In the context of growth rate, explain why we often approximate the running time of
an algorithm by ignoring lower-order terms.

The main term of the runtime often far outweigh the importance of lower-order
terms, especially as and taken on large values, therefore, we can summarize or
abstract away information by giving a “growth rate” or bound on the algorithms
performance.
123585511

07. What are the three types of time complexity analysis and briefly describe each?

Worst case : The worst case defines the case which the algorithm takes huge
time.
Best case : Best case defines the case which the algorithm takes lowest time.
Average case : Average case provides a prediction about the running time of
the algorithm.

08. What is operation count, and how is it used to estimate time complexity?

Operation count measures that number of fundamental operations an algorithm


performance as a function of its input size. It’s helps estimate the algorithm’s time
complexity. Which classifies algorithms by their efficiency and predicts
performance for large inputs.

09. Describe the step count method in analyzing time complexity.

The step count method is a systematic way to analyze an algorithm’s time


complexity by counting its basic operations. Its involves identifying fundamental
operations, breaking down the algorithm into segment .

You might also like