From ce7562ce7fc216a5ea25518fc9fcd74004173ed7 Mon Sep 17 00:00:00 2001 From: cjl1407 <1158477486@qq.com> Date: Wed, 8 Mar 2017 09:58:12 +0800 Subject: [PATCH 1/8] this is text --- group22/1158477486/src/my.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 group22/1158477486/src/my.txt diff --git a/group22/1158477486/src/my.txt b/group22/1158477486/src/my.txt new file mode 100644 index 0000000000..605f61fe72 --- /dev/null +++ b/group22/1158477486/src/my.txt @@ -0,0 +1 @@ +这是我的一个Git \ No newline at end of file From 0cdb2b2e8f08cf7f0fa81772aafdc5575d4e9aee Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 8 Mar 2017 09:59:06 +0800 Subject: [PATCH 2/8] java se --- group22/1158477486/src/myFist.java | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 group22/1158477486/src/myFist.java diff --git a/group22/1158477486/src/myFist.java b/group22/1158477486/src/myFist.java new file mode 100644 index 0000000000..136079fbac --- /dev/null +++ b/group22/1158477486/src/myFist.java @@ -0,0 +1,6 @@ + +public class myFist { +public static void main(String[] args) { + System.out.println("hello my love"); +} +} From 222e80b065e3b2555ace12ef5806b67e9f860488 Mon Sep 17 00:00:00 2001 From: cjl1407 <1158477486@qq.com> Date: Wed, 8 Mar 2017 12:59:34 +0800 Subject: [PATCH 3/8] this a java demo --- group22/1158477486/src/Test.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 group22/1158477486/src/Test.java diff --git a/group22/1158477486/src/Test.java b/group22/1158477486/src/Test.java new file mode 100644 index 0000000000..f106f0d3df --- /dev/null +++ b/group22/1158477486/src/Test.java @@ -0,0 +1,9 @@ + +public class Test { + + public static void main(String[] args) { + // TODO Auto-generated method stub +System.out.println("测试中------------"); + } + +} From 009358e1f49f5057ea678ebb9774c0bc00cfd873 Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 8 Mar 2017 17:15:07 +0800 Subject: [PATCH 4/8] =?UTF-8?q?list=20=E9=9B=86=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- group22/1158477486/src/TestCollection/List.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 group22/1158477486/src/TestCollection/List.java diff --git a/group22/1158477486/src/TestCollection/List.java b/group22/1158477486/src/TestCollection/List.java new file mode 100644 index 0000000000..1b14c3ebe6 --- /dev/null +++ b/group22/1158477486/src/TestCollection/List.java @@ -0,0 +1,9 @@ +package TestCollection; + +public interface List { + public void add(Object o); + public void add(int index, Object o); + public Object get(int index); + public Object remove(int index); + public int size(); +} From 170ad340bc4866dda0f7649bda50764345c1861f Mon Sep 17 00:00:00 2001 From: cjl1407 <115847486@qq.com> Date: Fri, 10 Mar 2017 18:37:33 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/TestCollection/ArrayList.java | 42 ++++ .../src/TestCollection/LinkedList.java | 184 ++++++++++++++++++ .../1158477486/src/TestCollection/Queue.java | 38 ++++ .../1158477486/src/TestCollection/Stack.java | 36 ++++ 4 files changed, 300 insertions(+) create mode 100644 group22/1158477486/src/TestCollection/ArrayList.java create mode 100644 group22/1158477486/src/TestCollection/LinkedList.java create mode 100644 group22/1158477486/src/TestCollection/Queue.java create mode 100644 group22/1158477486/src/TestCollection/Stack.java diff --git a/group22/1158477486/src/TestCollection/ArrayList.java b/group22/1158477486/src/TestCollection/ArrayList.java new file mode 100644 index 0000000000..b097267d50 --- /dev/null +++ b/group22/1158477486/src/TestCollection/ArrayList.java @@ -0,0 +1,42 @@ +package TestCollection; + +public class ArrayList implements List { + + + + private Object[] elementData = new Object[100]; + private int size ; + public void add(Object o){ + if(size==elementData.length){ + Object[]newData=new Object[size*2+1];//将数组扩容 + System.arraycopy(elementData, 0, newData, 0, elementData.length); + elementData=newData; + } + elementData[size++]=o; + + } + public void add(int index, Object o){ + System.arraycopy(elementData, index, elementData,index+1 , size-index); + elementData[index]=o; + size++; + } + + public Object get(int index){ + return elementData[index]; + } + + public Object remove(int index){ + System.arraycopy(elementData, index+1, elementData, index, size-index-1); + elementData[--size]=null; + return null; + } + + public int size(){ + return size; + } + + public Iterator iterator(){ + return null; + } + +} diff --git a/group22/1158477486/src/TestCollection/LinkedList.java b/group22/1158477486/src/TestCollection/LinkedList.java new file mode 100644 index 0000000000..6e1feda532 --- /dev/null +++ b/group22/1158477486/src/TestCollection/LinkedList.java @@ -0,0 +1,184 @@ +package TestCollection; + + + +public class LinkedList implements List { + + private Node head=new Node();; + private int size; + public Node node(int a){//鍒涘缓寰楀埌a浣嶇疆鑺傜偣鐨勬柟娉 + Node teamp=null; + + if(head!=null){ + if(a<=size ){ + teamp=head; + for(int i=0;i7->10 , 閫嗙疆鍚庡彉涓 10->7->3 + */ + public void reverse(){ + + } + + /** + * 鍒犻櫎涓涓崟閾捐〃鐨勫墠鍗婇儴鍒 + * 渚嬪锛歭ist = 2->5->7->8 , 鍒犻櫎浠ュ悗鐨勫间负 7->8 + * 濡傛灉list = 2->5->7->8->10 ,鍒犻櫎浠ュ悗鐨勫间负7,8,10 + + */ + public void removeFirstHalf(){ + + } + + /** + * 浠庣i涓厓绱犲紑濮嬶紝 鍒犻櫎length 涓厓绱 锛 娉ㄦ剰i浠0寮濮 + * @param i + * @param length + */ + public void remove(int i, int length){ + + } + /** + * 鍋囧畾褰撳墠閾捐〃鍜宭ist鍧囧寘鍚凡鍗囧簭鎺掑垪鐨勬暣鏁 + * 浠庡綋鍓嶉摼琛ㄤ腑鍙栧嚭閭d簺list鎵鎸囧畾鐨勫厓绱 + * 渚嬪褰撳墠閾捐〃 = 11->101->201->301->401->501->601->701 + * listB = 1->3->4->6 + * 杩斿洖鐨勭粨鏋滃簲璇ユ槸[101,301,401,601] + * @param list + */ + public static int[] getElements(LinkedList list){ + return null; + } + + /** + * 宸茬煡閾捐〃涓殑鍏冪礌浠ュ奸掑鏈夊簭鎺掑垪锛屽苟浠ュ崟閾捐〃浣滃瓨鍌ㄧ粨鏋勩 + * 浠庡綋鍓嶉摼琛ㄤ腑涓垹闄ゅ湪list涓嚭鐜扮殑鍏冪礌 + + * @param list + */ + + public void subtract(LinkedList list){ + + } + + /** + * 宸茬煡褰撳墠閾捐〃涓殑鍏冪礌浠ュ奸掑鏈夊簭鎺掑垪锛屽苟浠ュ崟閾捐〃浣滃瓨鍌ㄧ粨鏋勩 + * 鍒犻櫎琛ㄤ腑鎵鏈夊肩浉鍚岀殑澶氫綑鍏冪礌锛堜娇寰楁搷浣滃悗鐨勭嚎鎬ц〃涓墍鏈夊厓绱犵殑鍊煎潎涓嶇浉鍚岋級 + */ + public void removeDuplicateValues(){ + + } + + /** + * 宸茬煡閾捐〃涓殑鍏冪礌浠ュ奸掑鏈夊簭鎺掑垪锛屽苟浠ュ崟閾捐〃浣滃瓨鍌ㄧ粨鏋勩 + * 璇曞啓涓楂樻晥鐨勭畻娉曪紝鍒犻櫎琛ㄤ腑鎵鏈夊煎ぇ浜巑in涓斿皬浜巑ax鐨勫厓绱狅紙鑻ヨ〃涓瓨鍦ㄨ繖鏍风殑鍏冪礌锛 + * @param min + * @param max + */ + public void removeRange(int min, int max){ + + } + + /** + * 鍋囪褰撳墠閾捐〃鍜屽弬鏁發ist鎸囧畾鐨勯摼琛ㄥ潎浠ュ厓绱犱緷鍊奸掑鏈夊簭鎺掑垪锛堝悓涓琛ㄤ腑鐨勫厓绱犲煎悇涓嶇浉鍚岋級 + * 鐜拌姹傜敓鎴愭柊閾捐〃C锛屽叾鍏冪礌涓哄綋鍓嶉摼琛ㄥ拰list涓厓绱犵殑浜ら泦锛屼笖琛–涓殑鍏冪礌鏈変緷鍊奸掑鏈夊簭鎺掑垪 + * @param list + */ + public LinkedList intersection( LinkedList list){ + return null; + } +} + + \ No newline at end of file diff --git a/group22/1158477486/src/TestCollection/Queue.java b/group22/1158477486/src/TestCollection/Queue.java new file mode 100644 index 0000000000..4699235e98 --- /dev/null +++ b/group22/1158477486/src/TestCollection/Queue.java @@ -0,0 +1,38 @@ +package TestCollection; + + ; + +public class Queue { + private LinkedList list=new LinkedList(); + + public void enQueue(Object o){ + list.addLast ( o) ;//问题用add(index, o)出错 + } + + public Object deQueue(){ + Object o=list.get(1); + list.remove(1); + return o; + } + + public boolean isEmpty(){ + if(list.size()!=0){ + return false;}else + return true; + } + + public int size(){ + return list.size(); + } + public static void main(String[] args) { + Queue q=new Queue(); + q.enQueue("1"); + q.enQueue("2"); + q.enQueue("3"); + System.out.println(q.size()); + Object o=q.deQueue(); + System.out.println(o); + System.out.println(q.size()); + + } +} diff --git a/group22/1158477486/src/TestCollection/Stack.java b/group22/1158477486/src/TestCollection/Stack.java new file mode 100644 index 0000000000..35fdc6f31b --- /dev/null +++ b/group22/1158477486/src/TestCollection/Stack.java @@ -0,0 +1,36 @@ +package TestCollection; + +public class Stack { + private ArrayList elementData = new ArrayList(); + + public void push(Object o){ + elementData.add(o); + } + + public Object pop(){ + return elementData.get(elementData.size()-1) ; + } + + public Object peek(){ + elementData.remove(elementData.size()-1); + return elementData.get(elementData.size()-1); + } + public boolean isEmpty(){ + if(elementData.size()!=0){ + return false;} + return true; + } + public int size(){ + return elementData.size(); + } + public static void main(String[] args) { + Stack s=new Stack(); + s.push("111"); + s.push("211"); + s.push("311"); + System.out.println(s.size());//3 + System.out.println(s.pop()); + System.out.println(s.size()); + System.out.println(s.peek()); + System.out.println(s.size()); + }} From f0284b7cde7b9eea489136e82776cf7f3776f5ca Mon Sep 17 00:00:00 2001 From: cjl1407 <2832829901@qq.com> Date: Fri, 10 Mar 2017 18:42:13 +0800 Subject: [PATCH 6/8] Delete Test.java --- group22/1158477486/src/Test.java | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 group22/1158477486/src/Test.java diff --git a/group22/1158477486/src/Test.java b/group22/1158477486/src/Test.java deleted file mode 100644 index f106f0d3df..0000000000 --- a/group22/1158477486/src/Test.java +++ /dev/null @@ -1,9 +0,0 @@ - -public class Test { - - public static void main(String[] args) { - // TODO Auto-generated method stub -System.out.println("测试中------------"); - } - -} From a2a3d252f1dbb1b17420f50a20d181162129a364 Mon Sep 17 00:00:00 2001 From: cjl1407 <2832829901@qq.com> Date: Fri, 10 Mar 2017 18:42:33 +0800 Subject: [PATCH 7/8] Delete my.txt --- group22/1158477486/src/my.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 group22/1158477486/src/my.txt diff --git a/group22/1158477486/src/my.txt b/group22/1158477486/src/my.txt deleted file mode 100644 index 605f61fe72..0000000000 --- a/group22/1158477486/src/my.txt +++ /dev/null @@ -1 +0,0 @@ -这是我的一个Git \ No newline at end of file From 1203ca2ef020d297e5cf221c911fb8dcb7ce5f4f Mon Sep 17 00:00:00 2001 From: cjl1407 <2832829901@qq.com> Date: Fri, 10 Mar 2017 18:42:49 +0800 Subject: [PATCH 8/8] Delete myFist.java --- group22/1158477486/src/myFist.java | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 group22/1158477486/src/myFist.java diff --git a/group22/1158477486/src/myFist.java b/group22/1158477486/src/myFist.java deleted file mode 100644 index 136079fbac..0000000000 --- a/group22/1158477486/src/myFist.java +++ /dev/null @@ -1,6 +0,0 @@ - -public class myFist { -public static void main(String[] args) { - System.out.println("hello my love"); -} -}