I don’t understand how separate chaining works in hash maps if nodes have immutable values (i.e: data cant be modified).Im currently doing a project from the codecademy skill path of computer science, namely “blossom”, that implements separate chaining in hash maps its walkthrough video shows that if your key at a certain index of th linked list is same as the key entered you can just overwrite the data and cange the value which shouldnt be possible.
I’d suggest downloading the files onto a text editor (atom, sublime) that lets you have more than one window pane open at a time and see how the code inter-plays with each other. If you click on the folder icon in the module you can switch to see the code for linked_list.py.
Play with it and you’ll see what exactly is and isn’t immutable for your own reference (sometimes Codecademy doesn’t go into depth of providing side-cases, so don’t take their code at face-value). You can draw pictures of scenarios if you need extra help visualizing (hotel keycards, or bank tellers are useful in this instance, though there are many other analogies I’m sure).
Your list nodes can’t control whether contained values are mutable, only whether the nodes are mutable, but, are they, and, should they be?