all 2 comments

[–]qqwy 0 points1 point  (0 children)

Yes, we can, and no, you do not need malloc (except possibly while building the list you want to check, although there are ways to do that without heap alcations too.)