Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Google Applied CS - Day 1
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Harsh Vakharia
March 28, 2016
Education
0
130
Google Applied CS - Day 1
Day 1:
Anagram (HashSet, HashMap and ArrayList) and Scarne's dice
Harsh Vakharia
March 28, 2016
Tweet
Share
More Decks by Harsh Vakharia
See All by Harsh Vakharia
Google Applied CS - Day 4
harshjv
0
42
Google Applied CS - Day 3
harshjv
0
53
Google Applied CS - Introduction
harshjv
0
41
Other Decks in Education
See All in Education
あなたの言葉に力を与える、演繹的なアプローチ
logica0419
1
270
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
1014
cbtlibrary
0
530
Activité_5_-_Les_indicateurs_du_climat_global.pdf
bernhardsvt
0
140
栃木にいても「だいじ」だっぺ〜! 栃木&全国アジャイルコミュニティへの参加・運営の魅力
sasakendayo
1
140
1202
cbtlibrary
0
210
The browser strikes back
jonoalderson
0
370
1125
cbtlibrary
0
170
HCI Research Methods - Lecture 7 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.3k
1111
cbtlibrary
0
270
Going over the Edge
jonoalderson
0
340
TinyGoをWebブラウザで動かすための方法+アルファ_20260201
masakiokuda
2
210
Featured
See All Featured
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
170
Site-Speed That Sticks
csswizardry
13
1.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
120
BBQ
matthewcrist
89
10k
Paper Plane (Part 1)
katiecoart
PRO
0
4.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
180
Being A Developer After 40
akosma
91
590k
Facilitating Awesome Meetings
lara
57
6.8k
Mobile First: as difficult as doing things right
swwweet
225
10k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
720
Transcript
GOOGLE'S APPLIED CS WITH ANDROID DAY 1
ANAGRAMS
WHAT IS AN ANAGRAM? An anagram is a word formed
by rearranging the letters of another word. — Wikipedia
EXAMPLE Cinema is an anagram of iceman.
MECHANICS 1. Provide user a word from the dictionary. 2.
The user tries to create as many words as possible that contain all the letters of the given word plus one additional letter. 3. The user can give up and see the words that they did not guess.
CATCH The addition of extra letter at the beginning or
the end without reordering the other letters is not valid.
MEANING If the game picks the word 'ore' as a
starter, the user might guess 'rose' or 'zero' but not 'sore'. i.e. 1. rose ✅ 2. s(ore) ❌
STARTER CODE
ANAGRAMDICTIONARY'S CONSTRUCTOR WHAT IS NEEDED? 1. Word validation 2. Random
word selection 3. Get word's anagrams 4. Get words by length (ext)
WORD VALIDATION Set<String> wordSet = new HashSet<>(); ACCESS TIME: O(1)
RANDOM WORD SELECTION ArrayList<String> wordList = new ArrayList<>(); RANDOM ACCESS
TIME: O(1)
GET WORD'S ANAGRAMS Map<String, ArrayList<String>> lettersToWord = new HashMap<>(); ACCESS
TIME: O(1)
GET WORDS BY LENGTH Map<Integer, ArrayList<String>> sizeToWords = new HashMap<>();
SCARNE'S DICE
RULES 1. if they roll a 1, score no points
and lose their turn 2. if they roll a 2 to 6: ▸ add the rolled value to their points ▸ choose to either reroll or keep their score and end their turn
STARTER CODE
THIS IS IT FOR TODAY
ANY DOUBTS?