当前位置:网站首页>Force deduction ----- sort odd and even subscripts respectively
Force deduction ----- sort odd and even subscripts respectively
2022-07-29 04:55:00 【qq_ thirty-seven million seven hundred and sixty thousand seven】
/** * Note: The returned array must be malloced, assume caller calls free(). */
int* sortEvenOdd(int* nums, int numsSize, int* returnSize){
*returnSize=numsSize;
int b;
for(int a=1;a<numsSize;a=a+2){
for(int c=a+2;c<numsSize;c=c+2){
if(nums[a]<nums[c]){
b=nums[c];
nums[c]=nums[a];
nums[a]=b;
}
}
}
for(int a=0;a<numsSize;a=a+2){
for(int c=a+2;c<numsSize;c=c+2){
if(nums[a]>nums[c]){
b=nums[c];
nums[c]=nums[a];
nums[a]=b;
}
}
}
return nums;
}
边栏推荐
猜你喜欢
Correct user dragging method
Take you to understand JS array
央企建筑企业数字化转型核心特征是什么?
Torch.nn.crossentropyloss() details
SparkSql批量插入或更新,保存数据到Mysql中
SSM integration, addition, deletion, modification and query
[untitled]
UE 在场景或UMG中播放视频
un7.28:redis客户端常用命令。
Using jupyter (I), install jupyter under windows, open the browser, and modify the default opening address
随机推荐
GCC Basics
Makefile+make Basics
office2010每次打开都要配置进度怎么解决?
MySQL regularly calls preset functions to complete data update
安装spinning up教程里与mujoco对应的gym,报错mjpro150
What are the core features of the digital transformation of state-owned construction enterprises?
数据湖:分布式开源处理引擎Spark
How is the entered query SQL statement executed?
Reply from the Secretary of jindawei: the company is optimistic about the market prospect of NMN products and has launched a series of products
Five correlation analysis, one of the most important skills of data analysts
EF Core: 一对一,多对多的配置
Big silent event Google browser has no title
IOS interview preparation - IOS
Traffic flow prediction pit climbing record (I): traffic flow data set, original data
SparkSql批量插入或更新,保存数据到Mysql中
Learn matlab to draw geographical map, line scatter bubble density map
Detailed comparison of break and continue functions
New year's greetings from programmers
SSM integration, addition, deletion, modification and query
Mysql各版本下载地址及多版本共存安装