PROBLEM 4 (12 pts) - List of frequent elements Write a function which receives as input a lists and a number n (the freq

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

PROBLEM 4 (12 pts) - List of frequent elements Write a function which receives as input a lists and a number n (the freq

Post by answerhappygod »

Problem 4 12 Pts List Of Frequent Elements Write A Function Which Receives As Input A Lists And A Number N The Freq 1
Problem 4 12 Pts List Of Frequent Elements Write A Function Which Receives As Input A Lists And A Number N The Freq 1 (41.17 KiB) Viewed 25 times
PROBLEM 4 (12 pts) - List of frequent elements Write a function which receives as input a lists and a number n (the frequency), and returns as result a list of frequent elements (i.e. elements which appear at least n times in this list). def frequentElements (someList, n): Example: frequentElements([6,4,3,5,8,7,3,8,4,4,8],2) frequentElements([6,4,3,5,8,7,3,8,4,4,8],3) --> [3,8,4] --> [4,8] Note: the elements in the returned list should be according to the order they fulfill the frequency criterion (when checked left to right). Each frequent element should appear just once.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply