Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please, need help and this is the link for the article if you need it. https://student.cs.uwaterloo.ca/~cs231/resources/pseudocode.pdf Word Frequency lI'.:ounter [3D points] Implement an algorithm to

Please, need help and this is the link for the article if you need it. https://student.cs.uwaterloo.ca/~cs231/resources/pseudocode.pdf

image text in transcribedimage text in transcribedimage text in transcribed
Word Frequency lI'.:ounter [3D points] Implement an algorithm to count the occurences of each word in the paragraph below. 1'l'ou can copyr the text below as a string in your code. Your algorithm should be able to output all the 1lu'orrls in the below paragraph and the count of hornI many times it occured in this text. For example, techhungry appears once in the below paragraph Use a dictionary as a data structure. Also use the striggsglit function. I will post a video on how stringsglit works so you need not spend time on learning how to make stringlgglit worlrs. Use the string provided below as the startingr point. Copy all the italicized text below into your code. ewate garagnagh= "The Global Ewaste Monitor 2020 report Jlound that the world dumped a record 53.6 million tonnes of ewaste last year equivalent to the m weight of 35:0 cruise ships the size of the Queen Mary 2, or enough to form a line 125 kilometres long. That's an increase of 21 per cent in ve years, the report said._lust 1 14 per cent of it was recycled, meaning that an estimated $5? billion worth of gold, silver, copper, platinum and other high-value, recoverable materials used as components were mostly dumped or burned rather than being collected for treatment and reuse.China, with 10.1 million tonnes. was the biggest contributor to e-waste, and the United States was second with 6.9 million tonnes. lndia, with 3.2 million tonnesr was third. Together these three countries accounted for nearly 33 per cent of the world's ewaste last year. The new report also predicts global ewaste discarded products with a battery or plug will reach 24 million tonnes by 2035' almost a doubling of ewaste in just 16 gearsfwaste is a health and environmental hazard because it contains toxic additives or hazardous substances such as mercury. While the overall damage done to the environment from all the unrecycled waste may be incalculable, the message from the report was conclusive. The way in which we produce, consume and dispose of ewaste is unsustainable. Global warming is just one issue cited by the report as it noted 5'3 million tonnes of carbon dioxide equivalents were released into the atmosphere as a result of inadequate recycling of undocumented refrigerators and air conditioners.What is happening in india and China is symptomatic of a wider problem in developing countries where demand for goods lilre washing machines, refrigerators and air conditioners is rising rapidly"r Your answer should produce an output s_i_r!'!i_l_al_'_t_:r_:r_n this. the: 19 g 13 and: B ewaste: Ti and so on Senior Fronend Engineer Position Description (20 points) Here are the questions you should try to answer . What is your understanding of a frontend engineer? What skills are necessary to become one. Dont just list the names. Describe briefly. For example learning javascript or html. . What courses do you think cvsn help you get there? What are some questions that you could not understand or answer about this position. Bonus Questions Optional (advanced) for interested students . (+20) Create an algorithm to sort a list. You can use Bubble Sort , Insertion Sort or Selection Sort. Sort a list of 100000 numbers using this algorithm. Time your algorithm using the time module. Then sort this list using the inbuilt sorted() function in Python. How does the time of your algorithm compare to Python's running time. . (+10) How do you think about the efficiency of algorithms. How do you compare two algorithms in terms of their efficiency. (+10) How would you implement an undo button or a back button using Stacks? (+10 How would you implement a queue using the list in Python? (+10) What is the difference between linear search and binary search? (+30) Do you think the top scores algorithm can be optimized further? If so how?Code Hefootoring exercise [1!] points) Convert the following Python code into a function create list\". The function create list needs to return my_list. [Watch the lectures for how to create a list or how to write a function} import random my_li,st = [I MAX_LEN = 51!} for lingggEMAJLLEN]: my listaEEend[r-andorn.randint{1,99]] Find minimum number in a list [15 points] Write a Python function to get the minimum element from the list created above. For example, if you have a list [11,4,IE,2,29], your code should return you 2 as that is the minimum number. Leederboerd using a List [25 points] " Note: Read the article below on how to write gseudocodeJ have provided an example of Psedocode for the maximum number nding algorithm in the Google Colab notebook. Pseudoeode writing guidelines htt s: student.cs.uwaterloo.ca "c5231 resouroes seudooode. df Imagine you have a list Egg scores that can store only 5 numbers. Implement an algorithm in Python for storing the top 5 scores in a list. Provide the code and the algorithm in pseudocode of your algorithm. Use the following steps ' Generate 50 random numbers in a loop. ' Try to add every number to the list. i If list size is less than 5 all numbers generated get added. I After the list size goes above 5 and a new number is generated, it gets added if it can feature in the top 5. i For example, if the list currently has [1U,12,5,9,11] and new number generated is 42, then 42 will get added and the lowest number 5 will get replaced. g the list will be [10,12,42,9,11]. If the next number generated is 3, nothing will happen as 3 is lesser than all the numbers in the list. 111is 'u a herd question and you will really need to try to work this out using pencil and paper before trying to implement the algorithm in Python. But if you get it, you have made a lot of progress! ' Email me with questions or guesries

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions