题解 | #旋转数组的最小数字#

旋转数组的最小数字

https://www.nowcoder.com/practice/9f3231a991af4f55b95579b44b7a01ba

/**
 * 
 * @param rotateArray int整型一维数组 
 * @param rotateArrayLen int rotateArray数组长度
 * @return int整型
 */

 #include <math.h>

int cmp(const void*x,const void* y)
{
    return *(int*)x-*(int*)y;
}

int minNumberInRotateArray(int* rotateArray, int rotateArrayLen ) {
    qsort(rotateArray,rotateArrayLen,sizeof(int),cmp);
    return *rotateArray;
}

全部评论

相关推荐

暮雨轻歌:看起来hr不能接受我菜查看图片
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务