12 2015 档案
摘要:List:有序(存入和取出的顺序一致),元素都有索引(角标),允许重复元素。 常用方法: 1、添加 void add(index,element); void addAll(index,collection); 2、删除 Object remove(index); 3、修改 Object set(index,element...
阅读全文
摘要:#include #include typedef int ElemType; typedef struct LNode{ ElemType data; struct LNode* Next; }LNode,* LinkList; LinkList creat_list1(LinkList p){ p=(LNode *)malloc(sizeof(LNode))...
阅读全文
摘要:集合对我们来说一直是一个难点 集合是一个容器可以变长的存放各种类型的对象。 above all,Collection是最上层的接口所以他的方法,实现他的类都可以使用。 Collection的常见方法: 1、添加: boolean add(Object obj); boolean addAll(Collection coll); 2、删除: boo...
阅读全文
摘要:格式1: 元素类型[] 数组名 = new 元素类型[元素个数或数组长度];int [] arr=new int [5];格式2: 元素类型[] 数组名 = new 元素类型[]{};格式3: C语言格式import org.junit.Test;public class Arry { ...
阅读全文
摘要:#include#includestruct Student{ int sid; char name[200]; int age;}; //分号不能省略void main(){ struct Student st={1000,"z...
阅读全文
摘要:定义:内存地址(内存单元的编号)从0开始的非负整数范围是0-FFFFFFFF(0--4G-1)指针变量是存放内存单元地址的变量指针的本质是一个操作受限的非负数#includevoid main(){ int * p; //int * 是一个整型指针类型 p是一个变量 所有p是一个指向整...
阅读全文
摘要:1,不到万不得以是不使用递归的。因为效率比较低。2,知道需要运行多少次,我们一般希望使用迭代。一、阶乘(初级问题)#includeint fun(int n){ if(n==0) return 1; else return n*fun(n-1);}void m...
阅读全文