No testdata at current.
题意不明,暂无题解和数据
{"name":"bre","sort1":2,"sort2":3},
{“name”:"cat","sort1":5,"sort2":3},
{"name":"dog","sort1":1,"sort2":1},
根据数据中的“sort1”和“sort2”字段对数组进行排序,
要求设计一个算法,能够根据输入的orderBy值为要排序的字段和orderType值为(排序类型,升序或者降序)
根据sort1升序排序
orderBy=sort1
orderType=asc
dog
bre
cat
ace
输入
sort1 asc
输出
dog
bre
cat
ace