Question: (1) Python: Create FrequentWords() algorithm using the PatternCount() method (a) Example Input: Text = BABBASDCABCBABDDASDBBCASDBAB, k = 3 output: 'BAB', 'ASD' (b) do not use
(1) Python: Create FrequentWords() algorithm using the PatternCount() method
(a) Example
Input: Text = "BABBASDCABCBABDDASDBBCASDBAB", k = 3
output: 'BAB', 'ASD'
(b) do not use a dictionary
(c). Use the following pseudocode:
FrequentWords(Text, k) FrequentPatterns <-- an emty set for i <-- 0 to |Text| - k Pattern <-- the k-mer Text(i,k) Count(i) <-- PatternCount(Text,Pattern) maxCount <-- max value in array Count for i <-- 0 to |Text| - k if Count(i) = maxCount add Text(i,k) to FrequentPatterns remove duplicates from FrequentPatterns return FrequentPatterns
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
