CW7 -- Timing & Animation

13 views
Skip to first unread message

Akif Eyler

unread,
Nov 19, 2019, 12:53:21 AM11/19/19
to BLM

Akif Eyler

unread,
Nov 21, 2019, 2:22:10 AM11/21/19
to BLM
CW7 -- Timing  (due 3 pm)

* Start with this page in our repo:
https://maeyler.github.io/305/work/Timing

* Using that page and the same data, do a timing study for Array vs Map
1. read all Student id's into Array a using fetch().then().then()

2. make Map from id into Student
for (let s of a) map.set(s.id, s)

3. search 10.000 Student id's in both data separately
  Start with a 9-digit number such as 215170000 <-- select randomly
  Use an indexed for loop with 10.000 numbers
  Test:  a.includes(id)  and  map.has(id)

4. report the total number found and timing results (in msec)
  The total number must be the same for both data

Rastgele vereceğiniz ilk değerden başlayın, 10.000 sayıyı Array içinde ve Map içinde ayrı ayrı aratın, kaç tane bulduğunuzu ve toplam zamanı yazdırın 

* Put your work in your repo and add a link to it on the home page

Send me the link and a screen shot

_Akif_Eyler_

Reply all
Reply to author
Forward
Message has been deleted
0 new messages