Also... in which parts of Queens did you feel unsafe? Queens is actually quite safe.
Now I'm in Boston, in a heavily gentrified area, and I'm scared shitless after 11 pm. People all tell me it's a super safe area, but I know a few people who got mugged a few blocks away in various occasions.
Maybe it's just bad luck. Maybe compared to other areas, a few people getting their backpack stolen is nothing. But feelings are not always rationals. I don't feel safe here.
The Bronx is not a terribly safe place either.
Sure, downtown/midtown Manhattan are very safe, but Manhattan is a minority of the overall area of NYC.
Not all nor even a majority of homeless people developed countries are aggressive or unpredictable, but the risk is higher. Around here most of them are quite tame and humble, at least most of the time, and I'd much rather use the word "weak" than "bad", though.
But yes, homeless people can be scary. Being a stranger in SF, I was somewhat alarmed when driving in the city and finding myself in a central neighbourhood where I wouldn't want to stop at the red light.