Se está descargando tu SlideShare. ×

Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Cargando en…3
×

1 de 2 Anuncio

# Explain the function of the following methods in LinkedList 1- addFirs.docx

Explain the function of the following methods in LinkedList 1.
contains(E e) 3.
get(int index) 4. i
ndexOf(E e) 5.
remove() 6.
remove(int index) 7.
set(int index, E e)
Solution

2. contains(E e):
It searches element e in list.
If it is in list, it returs true otherwise false

3. get(int index):
this return element at index \'index\'

4. indexOf(E e):
this return index of element e in list if it is in list.
Otherwise it return -1

5. remove()
it removes last element from list

6. remove(int index)
it delete element at index \'index\'

7. set(int index, E e):
it replaces element at index \'index\' with element e
.

Explain the function of the following methods in LinkedList 1.
contains(E e) 3.
get(int index) 4. i
ndexOf(E e) 5.
remove() 6.
remove(int index) 7.
set(int index, E e)
Solution

2. contains(E e):
It searches element e in list.
If it is in list, it returs true otherwise false

3. get(int index):
this return element at index \'index\'

4. indexOf(E e):
this return index of element e in list if it is in list.
Otherwise it return -1

5. remove()
it removes last element from list

6. remove(int index)
it delete element at index \'index\'

7. set(int index, E e):
it replaces element at index \'index\' with element e
.

Anuncio
Anuncio