LinkedList Part

前端 未结 4 1321
小鲜肉
小鲜肉 2021-01-28 12:44

I think I might have done something right, headByRating and headByName both refer to the same address.

I have been drawing diagras working all day trying new things etc,

4条回答
  •  闹比i
    闹比i (楼主)
    2021-01-28 12:55

    Why are you rolling your own linked list? Why not use std::list? If it's for the double-sorting thing, two separate lists of pointers would work, and be a hell of a lot easier if you can then use the provided container classes.

    Or alternatively, if you need to sort it, is a linked list the best option? std::vector is often easier for sorting, or std::set maintains the order itself.

提交回复
热议问题