# 14093 - Sorting ㄇㄧㄥˊ ㄗˋ ## Brief You are tasked to implement two helper functions to sort the list of name by Zhuyin order. For detailed explanation, visit [this link](https://acm.cs.nthu.edu.tw/problem/14093/). ![Zhuyin Table](https://hackmd.io/_uploads/rJiDtFDNT.png) ## Idea [Same ship, different story](https://hackmd.io/@6kxdNGuPRSeglF0SFLitMA/BJ1c4afET) ## Solution <details> <summary>ㄇㄟˊ ㄒㄧㄝˇ ㄨㄢˊ ㄅㄨˋ ㄓㄨㄣˇ ㄊㄡ ㄎㄢˋ</summary> ```c= void SwapString(char **str1, char **str2) { char *tmp = *str1; *str1 = *str2; *str2 = tmp; } int Partition(char **A, int l, int r) { int i = l; for (int j = l; j < r; j++) { if (compareByZhuyin(A[j], A[r]) < 0) { SwapStrings(&A[i], &A[j]); i++; } } SwapStrings(&A[i], &A[r]); return i; } ``` </details>