Question d'entretien d'embauche Hike: ques : what is the difference... | Glassdoor.ca

Question d'entretien d'embauche

Entretien de QA Automation Engineer(Candidat étudiant) Dehradun (Inde)

ques : what is the difference between tinkliest and array

  list in terms of complexity time and space and also for operation like insert, delete , sort , search.
Répondre

Réponse de l'entretien

1 réponse

0

I guess its Linklist not tinkliest.
Comparision of Complexity

LinkedList :

get():O(n)
add():O(1)
remove():O(1)

ArrayList

get():O(1)
add():O(1)
remove:O(n)

The fact : add/remove operation are assumed to be faster in Linked list.
Reason:In ArrayList by default size is 10.And increases using 50% increment rule.

So for Large Data Set where u have lot of insertion/remove but not frequent access to value One should use LinkedList.
For more frequent access to dataset one should use ArrayList.

Rajat, le 14 mai 2015

Ajouter des réponses ou des commentaires

Pour commenter ceci, se connecter ou s'inscrire