in traveling salesman problem why we have used bit mask to store the visited node . can’t we do it like bool visited array we used in earlier implementation .
Traveling salesman problem?
hello @mehulbhandari358
bitmask is a single number so its easy to memoise it. but in case we use bool we need array. which is not easily memoisable
but in every earlier implementation like-dis ,bfs we used a bool visited array ?
…
here we have to memoise it as well. using array is not good option
can you pls elaborate ?
…
elaborate what? in case of bitmask we have one single integer and we are updating it.
whereas in case of bool we will have array of size n. we cannot memoise it.
pls revise top down dp and memoisation
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.