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
Alright, so for challenge number two, 2
2
I want you to work with a singly-linked list 3
3
that handles integers, so it stores integer objects. 4
4
So what I've done is, I quickly updated 5
5
the employee link list class that we implemented 6
6
so that it stores integers instead of employees. 7
7
I was gonna make you do it, but then I thought, 8
8
oh that's just trivial work, so I'll do that for you. 9
9
So there's a starter project in the resources section 10
10
that contains all the code that you'll need, 11
11
and what I want you to do is, I want you 12
12
to implement a method in the IntergerLinkedList class 13
13
that inserts a value in sorted order. 14
14
If you look at the class, I think 15
15
I called the method insertSorted, 16
16
and instead of calling the add to front method, 17
17
we'll keep calling insertSorted 18
18
and so the values are always inserted in sorted order. 19
19
And what I mean by sorted order is 20
20
that the lower values should appear first in the list, 21
21
so they should be closer to the head. 22
22
And so if we were to insert value four, 23
23
and then two, and then one, and then five, 24
24
the list would look like the following. 25
25
You'd have the node for one, and then the node for two, 26
26
and then four, and then five, 27
27
and five would be the last node in the list, 28
28
and its next field would point to null. 29
29
And so IntegerLinkedList is a singly-linked list, 30
30
and I want it to remain a singly-linked list, 31
31
this would be an easier challenge 32
32
if it was a doubly-linked list. 33
33
So, as I said, the project contains all the code you'll need 34
34
and the main method has the code that should work 35
35
when you're finished, so when you've finished implementing 36
36
the insertSorted method, you can then run the main method, 37
37
and the list that prints should have the nodes 38
38
in sorted order. 39
39
So, good luck with that, 40
40
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.