using sort() in STL to sort an array

后端 未结 6 2162
无人共我
无人共我 2020-12-10 19:31

I am writing code for a question which is: Write a method to sort an array of strings so that all the anagrams are next to each other. If my container is vector, it will be

6条回答
  •  余生分开走
    2020-12-10 19:33

    Pointers can act as iterators, so you just need pointers to the beginning and just past the end of the array.

提交回复
热议问题