https://en.cppreference.com/w/...
"If comp indicates two elements as equivalent, their order is unspecified."
qsort의 stable 여부는 표준상 unspecified이기 때문에, 구현체에 따라서 stable하게 해준다고 하더라도 문제는 없습니다.
1377번 - 버블 소트
https://en.cppreference.com/w/...
"If comp indicates two elements as equivalent, their order is unspecified."
qsort의 stable 여부는 표준상 unspecified이기 때문에, 구현체에 따라서 stable하게 해준다고 하더라도 문제는 없습니다.
댓글을 작성하려면 로그인해야 합니다.
buddy427 2년 전
제가 c언어로 푸신 다른 블로그에 있는 코드를 찾아보다가 그냥 qsort에 unstable하게 푸는 것 같은데 백준에서는 정답으로 처리가 되어서 어떤 것이 차이가 있는지 궁금합니다.