Hi guys,
when i am coding I always have problems keeping track of my pointers and array-indices.
Eg.
- when do you update them in the loop - at the beginning or the end
- for the end of list - do i use postprocessing or can it be written nicely within the loop
- using for vs while in certain scenarios - what works best here
- two-pointer algs: do you look at the next item or the current, what if left and right are at the same position,...
- ..
- don't get me started on 2D arrays....
I always get confused and am not clear in my head, what the contents of them currently are during the steps.
Do you have any mental tricks how you organize them?
Any tips?