Can we pass hashmap to a recursive funcition, If yes what could be the disadvantages
Pass by reference or value?
why would that matter
Pass by reference passes the address, takes O(1) time.
Pass by value creates a new copy. It will copy all keys and values of the hashmap into a new one. This is much slower.
Why not give it a try instead of asking it ?
This post was flagged by the community and is temporarily hidden.