Docsity

DSA-Data Structures and Algorithms shorts notes, Schemes and Mind Maps of Computer Programming

Partial preview of the text

Download DSA-Data Structures and Algorithms shorts notes and more Schemes and Mind Maps Computer Programming in PDF only on Docsity!

"How much time it takes to vun a-function as ane @ input AYows. —_— Wze of tne inp a =< a co aa aa ber of Const ten “pevayl = (OBS, & PI Let!s see if théve is aneedle in the haystack ! QS Const numNeedles= (haystack, needle) + & let count=0 for (ler i205 haystack.lengeh j itr)? , HF Chaystack [iJ = needle) Count+=1; | ‘Gne Count 5 V3 i i a ee 4 How long does it take to execute when +he a of elements (rn) 15° ¥v exertion \ % er ris time ayows Linear hme linearly, as Com : OAVYOY Size PLT increases » K yw On)