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
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
Cifrado asimétrico
irocho
0
380
Surviving the surfaceless web
jonoalderson
0
350
Web 2.0 Patterns and Technologies - Lecture 8 - Web Technologies (1019888BNR)
signer
PRO
0
3k
RGBでも蛍光を!? / RayTracingCamp11
kugimasa
2
380
MySmartSTEAM 2526
cbtlibrary
0
190
Security, Privacy and Trust - Lecture 11 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
TinyGoをWebブラウザで動かすための方法+アルファ_20260201
masakiokuda
2
210
自己紹介 / who-am-i
yasulab
PRO
6
6.3k
学習指導要領と解説に基づく学習内容の構造化の試み / Course of study Commentary LOD JAET 2025
masao
0
120
滑空スポーツ講習会2025(実技講習)EMFT講習 実施要領/JSA EMFT 2025 procedure
jsaseminar
0
110
Adobe Express
matleenalaakso
2
8.1k
0203
cbtlibrary
0
110
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1371
200k
Into the Great Unknown - MozCon
thekraken
40
2.3k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
120
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
330
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Design in an AI World
tapps
0
140
YesSQL, Process and Tooling at Scale
rocio
174
15k
Building AI with AI
inesmontani
PRO
1
690
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
Paper Plane
katiecoart
PRO
0
46k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
The Spectacular Lies of Maps
axbom
PRO
1
520
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?