- 博客(6)
- 收藏
- 关注
原创 PAT (Basic Level) Practice 1008 数组元素循环右移问题 (20 分)
先翻转前n-m个,再翻转后m个,最后整个数组翻转坑:m可能大于n,之前先处理m, m %= n代码#include<bits/stdc++.h>using namespace std;void reverse( int arr[], int begin, int end ){ for( int i = begin; i <= (begin+end)/2; i++ ){ int tmp = arr[i]; arr[i] = arr[end-i+begin]; ar.
2021-09-03 21:35:44
78
原创 PTA-数据结构-03-树2 List Leaves
PTA-数据结构-03-树2 List LeavesGiven a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (≤10) which
2021-04-28 22:03:34
112
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人