Duke Computer Science fileDNA 13 61 tgatagcagc ttctgaactg gttacctgcc gtgagtaaat taaaatttta...

23
Duke Computer Science Friday, October 19, 12

Transcript of Duke Computer Science fileDNA 13 61 tgatagcagc ttctgaactg gttacctgcc gtgagtaaat taaaatttta...

Duke Computer ScienceFriday, October 19, 12

•Pick up your exam

•if there is a “total” do NOT assume that it is correct

•Check that you have all of your points

•Check your grade on Sakai

•If any of these are wrong, please let us know ASAP so that we can fix it

2Friday, October 19, 12

Today•The exam

•Intro to DNA assignment

•Back to linked lists

3Friday, October 19, 12

The Exam

4

10#5#

22#

46#

37#

0#5#

10#15#20#25#30#35#40#45#50#

0.6# 0.7# 0.8# 0.9# 1#

Peop

le&

Points&

Exam&Grades&

ABC

Friday, October 19, 12

Question 0

5

0"

10"

20"

30"

40"

50"

60"

0" 2" 4" 6" 8" 10" 12" 14" 16"

Peop

le&

Points&

Ques-on&0&

Friday, October 19, 12

Question 1

6

0"

20"

40"

60"

80"

100"

120"

0" 2" 4" 6"

Peop

le&

Points&

Ques-on&1&

Friday, October 19, 12

Question 2

7

0"

10"

20"

30"

40"

50"

60"

70"

0" 2" 4" 6"

Peop

le&

Points&

Ques-on&2&

Friday, October 19, 12

Question 3

8

0"

10"

20"

30"

40"

50"

60"

70"

0" 2" 4" 6" 8" 10" 12" 14"

Peop

le&

Points&

Ques-on&3&

Friday, October 19, 12

Question 4

9

0"

20"

40"

60"

80"

100"

120"

0" 2" 4" 6"

Peop

le&

Points&

Ques-on&4&

Friday, October 19, 12

Question 5

10

0"10"20"30"40"50"60"70"80"90"100"

0" 2" 4" 6" 8"

Peop

le&

Points&

Ques-on&5&

Friday, October 19, 12

Question 6

11

0"

10"

20"

30"

40"

50"

60"

70"

0" 2" 4" 6" 8" 10"

Peop

le&

Points&

Ques-on&6&

Friday, October 19, 12

Question 7

12

0"

10"

20"

30"

40"

50"

60"

70"

80"

0" 2" 4" 6" 8" 10" 12"

Peop

le&

Points&

Ques-on&7&

Friday, October 19, 12

DNA

13

61 tgatagcagc ttctgaactg gttacctgcc gtgagtaaat taaaatttta ttgacttagg 121 tcactaaata ctttaaccaa tataggcata gcgcacagac agataaaaat tacagagtac 181 acaacatcca tgaaacgcat tagcaccacc attaccacca ccatcaccat taccacaggt 241 aacggtgcgg gctgacgcgt acaggaaaca cagaaaaaag cccgcacctg acagtgcggg 301 cttttttttt cgaccaaagg taacgaggta acaaccatgc gagtgttgaa gttcggcggt 361 acatcagtgg caaatgcaga acgttttctg cgtgttgccg atattctgga aagcaatgcc 421 aggcaggggc aggtggccac cgtcctctct gcccccgcca aaatcaccaa ccacctggtg 481 gcgatgattg aaaaaaccat tagcggccag gatgctttac ccaatatcag cgatgccgaa 541 cgtatttttg ccgaactttt gacgggactc gccgccgccc agccggggtt cccgctggcg 601 caattgaaaa ctttcgtcga tcaggaattt gcccaaataa aacatgtcct gcatggcatt 661 agtttgttgg ggcagtgccc ggatagcatc aacgctgcgc tgatttgccg tggcgagaaa 721 atgtcgatcg ccattatggc cggcgtatta gaagcgcgcg gtcacaacgt tactgttatc 781 gatccggtcg aaaaactgct ggcagtgggg cattacctcg aatctaccgt cgatattgct 841 gagtccaccc gccgtattgc ggcaagccgc attccggctg atcacatggt gctgatggca 901 ggtttcaccg ccggtaatga aaaaggcgaa ctggtggtgc ttggacgcaa cggttccgac 961 tactctgctg cggtgctggc tgcctgttta cgcgccgatt gttgcgagat ttggacggac 1021 gttgacgggg tctatacctg cgacccgcgt caggtgcccg atgcgaggtt gttgaagtcg

Friday, October 19, 12

Restriction Enzymes

14Friday, October 19, 12

Restriction Enzymes

15Friday, October 19, 12

Restriction Enzymes

16Friday, October 19, 12

Two kinds of lists

17

SimpleStrandJust make a copy!(Provided!)

O(n) in time and space

Friday, October 19, 12

Two kinds of lists

18

SimpleStrandJust make a copy!

Do splicing

(Provided!)

LinkStrand(Your responsibility!)

Runs in O(n)

Runs in O(b)Friday, October 19, 12

“Code that already works”

19Friday, October 19, 12

Interface

20

public interface IMapper {

public abstract boolean containsKey(String key);

public abstract int get(String key);

public abstract void put(String key, int value);

public abstract void printAll(); public abstract int size();

}

Friday, October 19, 12

Interface

20

public interface IMapper {

public abstract boolean containsKey(String key);

public abstract int get(String key);

public abstract void put(String key, int value);

public abstract void printAll(); public abstract int size();

}

Friday, October 19, 12

A Map•Can be implemented with:

•array list

•hash map

•linked list

•But it still works like a map!

21Friday, October 19, 12

Code•Snarf the code for today’s recitation

•Complete the recitation7 assignment from the webpage

22Friday, October 19, 12