A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 4 years ago
Hello everyone, I have some trouble in ps6 problem 3. I don't know how to change the complexity of is_valid_word from O(len(word_list)) to O(1) by change the arguments.
anonymous
 4 years ago
Hello everyone, I have some trouble in ps6 problem 3. I don't know how to change the complexity of is_valid_word from O(len(word_list)) to O(1) by change the arguments.

This Question is Closed

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0use a dictionary?? http://wiki.python.org/moin/TimeComplexity

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0Using a dictionary is exactly the right idea. Recall that the dictionary works using hashing which allows us to search in constant time. Think about changing the input of is_valid_word from word_list to a dictionary such as points_dict .
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.