If it is unordered the best way to go is linear search, in case you need to search an LOT of times then and only then I would consider sorting it. Since sorting with comparison methods has at least O(nlogn). Altought i'm ignoring counting methods that can be done linearly
I said I would sort it regarding his question. Since, he asked "how would you sort list first", but you are right going with linear search makes sense if it's unordered.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If it is unordered the best way to go is linear search, in case you need to search an LOT of times then and only then I would consider sorting it. Since sorting with comparison methods has at least O(nlogn). Altought i'm ignoring counting methods that can be done linearly
I said I would sort it regarding his question. Since, he asked "how would you sort list first", but you are right going with linear search makes sense if it's unordered.