java - What is the time complexity of converitng a Map to Linked list -
java - What is the time complexity of converitng a Map to Linked list -
i have map
, converting linkedlist
. example
list<map.entry<long, long>> list = new linkedlist<map.entry<long, long>>(unsortmap.entryset());
i need find out time complexity of doing above operation.
the complexity o(n) n number of entries. loop on entries phone call of list.add(entry).
for(entry<long,long> e : unsortmap.entryset()){ list.add(e); }
java map time-complexity
Comments
Post a Comment