1. Engineering
  2. Computer Science
  3. classify the time complexity for each function using bigo notation...

Question: classify the time complexity for each function using bigo notation...

Question details

Classify the time complexity for each function using Big-O notationdef anagramSolution4 (sl, s2): cl-[0] 26 c2-[0] 26 for i in range (Jea (s1)): for i in range (Jea (s2)) stidlo-True while j<26 and SKA0J00,: if cl[j] c2jl: else: stidleFalse return SkadJOĶdef anagramSolution2 (sl,s2): alistl -list (s1) alist2-list (s2) alistl.sort () alist2.sort () matchesTrue while p9S < den (sl) and matches: if alistl psalist2 [p931: else matches False return matchesdef anagramSolution3 (s1,s2): perms -[ .join (p) for p in permutations (s2) ] found-False tor s in perm s: if sls: found-True break return found5 def anagramSolution1 (sl, s2) 6 aist- list (s2) pos1 = 0 9 0 = True while posl < lea (sl) and stiddek pos2 0 found False 2 while pos2 < lex(alist) and not found: 6 found -True else: pos2pos2 1 9 0 if found: 9deak [pos2] None else: stidleFalse poslposl +1 6 return SkadJOĶ

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution