in the case of the undirected graph, can we assume the graph is connected?
Yes, you can, but it shouldn't make that much of a difference.
If it is crucial for your answer that the graph is connected, you should take some time to understand why, because it really shouldn't take more than a few words to modify your answer to general graphs.
its just that in the instructions its written that if both solutions has same complexity then points will be lowered
if i understand the significance of the undirected graph being connected, then i think that the complexity without this assumption should be similar to both cases, and with the connectivity assumtion the cases truely have different complexities
am i in the right direction here or is it suppose to be different complexity even when we cant assume the graph is connected?
The question is slightly easier if you can assume that the graph is connected, but if you solve it for the connected case, it should be pretty straightforward to extend it to the general case. If you don't find it straightforward, then definitely solve it when you can't assume that the graph is connected.