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

Popular posts from this blog

c - Compilation of a code: unkown type name string -

ubuntu - Bash Script to Check That Files Are Being Created -

Php operator `break` doesn't stop while -