Afrikaans
Akan
Albanian
Amharic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
1 1
Okay, the first challenge in this section 2
2
is to implement the addBefore method 3
3
for the EmployeeDoublyLinkedList class. 4
4
This method will take two employees. 5
5
The first employee will be the employee 6
6
you want to add to the list 7
7
and the second employee will be 8
8
an existing employee in the list 9
9
and what the addBefore method will do is 10
10
it will insert the new employee into the list 11
11
right before the existing employee. 12
12
So if you call addBefore and you pass 13
13
James Bond as the new employee, 14
14
and John Doe as the existing employee 15
15
then what this method should do is insert James Bond 16
16
right before John Doe, in the list. 17
17
Now there's a starter project in the Resources section 18
18
that you can use. 19
19
It has all the code you need. 20
20
So it has the code for the LinkedList, 21
21
it's the same LinkedList that we implemented 22
22
when we implemented the DoublyLinkedList 23
23
and it also has an empty addBefore method 24
24
inside the EmployeeDoublyLinkedList class. 25
25
And if you look at the main method 26
26
in the main.Java file, you'll see that there's code there 27
27
and that code should work when you're finished. 28
28
So once you've implemented the addBefore method, 29
29
run the main method and you should see 30
30
the new employee added before 31
31
the employee that you specified. 32
32
So good luck with this challenge 33
33
and I'll see you in the solution video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.