0% found this document useful (0 votes)
19 views

Assignment Answers

Discrete Mathematics Assignment Vit

Uploaded by

ABHISHEK MISHRA
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)
19 views

Assignment Answers

Discrete Mathematics Assignment Vit

Uploaded by

ABHISHEK MISHRA
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/ 1

Assignment –I

Faculty : Prof.Srinivasa Rao

Submission date :20-9-2017

(1)Given f(x)= a0+a1 x+a2 x2+…+an xn , where ao, a1, a2, … an and x are given
positive integers. Let k be a given positive integer. Design an algorithm to calculate the value

of f(k) .Use linked list data structure to compute the value of f(k ). Analyse the time
complexity of your algorithm.
(2)Let f (n)=1+3+5+7 …+(2 n−3)+(2 n−1). Is it true that f (n)=O(n 4 )? Justify your
answer.
(3)Analyse the time complexity of the following algorithm
MMM ( int A[ ], int B[ ])
For i  1 to n
For j 1 to n
B[i]= A[i] * A[j]
End for
End for
End MMM
Design two algorithms (iterative and recursive) to print the following picture printing. Analyse the time
complexities of your algorithms.

A
BC
CDEF
DEFGHIJK
EFGHIJKLMNOPQRST

You might also like