| 目标 |
500 |
|
100小时 |
掌握Java程序设计 |
| 第十一周 |
30/30 |
0/0 |
20/20 |
学习结构化设计FOR |
| 第十二周 |
30/60 |
0/0 |
18/38 |
学习继承性,多态性 |
| 第十三周 |
20/80 |
100/100 |
22/60 |
学习了包,封装性口 |
| 第十四周 |
160/240 |
0/100 |
20/80 |
学习了数组,字符串 |
| 第十五周 |
100/260 |
50/150 |
20/100 |
数组,字符串的应用 |
public class xx{
public static void main(String []args)
{
int[]a={15,1,2,5,12,15,1,2,5,35};
int st=0;
int en=a.length-1;
main(a,st,en);
for(int i=0;i<a.length;i++)
{
System.out.print(a[i]+" ");
}
}
public static void main(int[] a,int lo,int hi)
{
int st=lo;
int en=hi;
while(en>st)
{//后面的和前面的比较
while(en>st&&a[en]>=a[lo]) //如果没有比值小的,比较下一个,有比他小的就交换位置,然后又从前往后比较
en--;
if(a[en]<=a[lo])
{
int temp=a[en];
a[en]=a[st];
a[st]=temp;
}
//前面的和后面的比较
while(en>st&&a[st]<=a[lo]) //如果没有比值小大的,比较下一个,有比他大的就交换位置,然后又从后向前比较
st++;
if(a[st]>=a[lo])
{
int temp=a[st];
a[st]=a[en];
a[en]=temp;
}
}
if(st>lo) main(a,lo,st-1);
if(en<hi) main(a,en+1,hi);
}
}
数据结构是大二学习的课程了,现在做的题排序的题有一些印象,但是没有大二的时候那么有头绪了,知道快速排序是怎么回事,但是正真做起来很有难度,如果放在数据结构的后面学习的话,感觉能够好一些,没这么大的断档的感觉QAQ,
编程好难,再接再厉