leetcode 链表相关算法题

package linkedlist;


import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashSet;
import java.util.List;
import java.util.PriorityQueue;


class ListNode{
int val;
ListNode next;
ListNode(int x){
this.val=x;
}
}




public class AddTwoNumber {


public static void main(String[] args) {

ListNode l1=new ListNode(1);
ListNode l2=new ListNode(2);
ListNode l3=new ListNode(3);
ListNode l4=new ListNode(3);
ListNode l5=new ListNode(4);
ListNode l6=new ListNode(4);
ListNode l7=new ListNode(5);

l1.next=l2;
l2.next=l3;
l3.next=l4;
l4.next=l5;
l5.next=l6;
l6.next=l7;

printcontent(l1);
ListNode ln=deleteDuplicates3(l1);
printcontent(ln);
}

public static ListNode addTwoNumbers(ListNode l1, ListNode l2) {
ListNode c1 = l1;
        ListNode c2 = l2;
        ListNode sentinel = new ListNode(0);
        ListNode d = sentinel;
        int sum = 0;
        while (c1 != null || c2 != null) {
            sum /= 10;
            if (c1 != null) {
                sum += c1.val;
                c1 = c1.next;
            }
            if (c2 != null) {
                sum += c2.val;
                c2 = c2.next;
            }
            d.next = new ListNode(sum % 10);
            d = d.next;
        }
        if (sum / 10 == 1)
            d.next = new ListNode(1);
        return sentinel.next;
    }

//print ListNode
public static void printcontent(ListNode ln){
StringBuffer sb=new StringBuffer();
sb.setLength(0);
while(ln.next!=null){
sb.append(ln.val+"->");
ln=ln.next;
}
sb.append(ln.val);
System.out.println(sb.toString());
}

//get link list size
public static int getsize(ListNode ln){
int count=1;
while(ln.next!=null){
count++;
ln=ln.next;
}
return count;
}

//reverse link list
public static ListNode reverse(ListNode head){
ListNode newhead=null;
while(head!=null){
ListNode tmp=head.next;
head.next=newhead;
newhead=head;
head=tmp;
}
return newhead;
}

//if has circle
public static boolean hasCircle(ListNode head){
if(head == null){
return false;
}
ListNode walker=head;
ListNode runner=head;
while(runner.next!=null && runner.next.next!=null){
walker=walker.next;
runner=runner.next.next;
if(walker==runner){
return true;
}
}
return false;
}

public static ListNode detectCycle(ListNode head){
HashSet nodes=new HashSet();
ListNode current=head;
while(current!=null){
if(nodes.contains(current)){
return current;
}
nodes.add(current);
current=current.next;
}
return null;
}

public static boolean hasCircle1(ListNode head){
ListNode p=head;
ListNode pre=head;
while(p!=null && p.next!=null){
if(p.next==head){
return true;
}
p=p.next;
pre.next=head;
pre=p;
}
return false;
}
//delete node
public static void deleteNode(ListNode del){
if(del.next==null){
return;
}
del.val=del.next.val;
ListNode temp=del.next;
del.next=del.next.next;
}

//merge two sorted listNode
public static ListNode mergeTwolists(ListNode l1,ListNode l2){
if(l1==null){
return l2;
}
if(l2==null){
return l1;
}
ListNode mergehead;
if(l1.val<l2.val){
mergehead=l1;
mergehead.next=mergeTwolists(l1.next,l2);
}else{
mergehead=l2;
mergehead.next=mergeTwolists(l1,l2.next);
}
return mergehead;
}
//merge sort
public static ListNode merge(ListNode l1,ListNode l2){
ListNode l=new ListNode(0);
ListNode p=l;
while(l1!=null&&l2!=null){
if(l1.val<l2.val){
p.next=l1;
l1=l1.next;
}else{
p.next=l2;
l2=l2.next;
}
p=p.next;
}
if(l1!=null){
p.next=l1;
}
if(l2!=null){
p.next=l2;
}
return l.next;
}
public static ListNode sortList(ListNode head){
if(head == null || head.next==null){
return head;
}
//step 1 cut the list to two halves
ListNode prev=null;
ListNode slow=head;
ListNode fast=head;
while(fast!=null&&fast.next!=null){
prev=slow;
slow=slow.next;
fast=fast.next.next;
}
prev.next=null;
//step 2 sort each half
ListNode l1=sortList(head);
ListNode l2=sortList(slow);
//step 3 merge l1 and l2
//return merge(l1,l2);
return mergeTwolists(l1,l2);
}
//qiuck sort
public static ListNode sortlist1(ListNode head){
if(head==null||head.next==null){
return head;
}
ListNode dummy1=new ListNode(0);
ListNode dummy2=new ListNode(0);
ListNode prev1=dummy1;
ListNode prev2=dummy2;
ListNode node=head.next;
ListNode prev=head;
while(node!=null){
if(node.val<head.val){
prev1.next=node;
prev1=prev1.next;
}else if(node.val>head.val){
prev2.next=node;
prev2=prev2.next;
}else{
prev.next=node;
prev=prev.next;
}
node=node.next;
}
prev1.next=prev2.next=prev.next=null;
dummy1.next=sortlist1(dummy1.next);
dummy2.next=sortlist1(dummy2.next);
prev1=dummy1;
while(prev1.next!=null){
prev1=prev1.next;
}
prev1.next=head;
prev.next=dummy2.next;
return dummy1.next;
}

//get length
public static int getlength(ListNode l){
        int i=0;
while(l!=null){
i++;
l=l.next;
}
return i;
}

//find intersection node
public static ListNode getintersectionNode(ListNode l1,ListNode l2){
int len1=getlength(l1);
int len2=getlength(l2);
while(len1>len2){
l1=l1.next;
len1--;
}
while(len2>len1){
l2=l2.next;
len2--;
}
while(l1!=l2){
l1=l1.next;
l2=l2.next;
}
return l1;


public static ListNode getintersectionNode1(ListNode l1,ListNode l2){
//boundary check
if(l1==null || l2==null){
return null;
}
ListNode a=l1;
ListNode b=l2;
//if a,b have different length,then we will stop the loop after second iteration
while(a!=b){
//for the end of first iteration, we just reset the pointer to the heap of another linkedlist
a=a==null? l1:a.next;
b=b==null? l2:b.next;
}
return a;
}

//merge k lists
public static ListNode mergeKLists(List<ListNode> lists){
if(lists==null || lists.size()==0){
return null;
}
PriorityQueue<ListNode> queue=new PriorityQueue<ListNode>(lists.size(),new Comparator<ListNode>(){
public int compare(ListNode o1,ListNode o2){
if(o1.val<o2.val){
return -1;
}else if(o1.val==o2.val){
return 0;
}else{
return 1;
}
}
});
ListNode dummy=new ListNode(0);
ListNode tail=dummy;
for(ListNode node:lists){
if(node!=null){
queue.add(node);
}
}
while(!queue.isEmpty()){
tail.next=queue.poll();
tail=tail.next;
if(tail.next!=null){
queue.add(tail.next);
}
}
return dummy.next;
}

public static ListNode mergeKlists1(List<ListNode> lists){
if(lists.size()==0){
return null;
}
if(lists.size()==1){
return lists.get(0);
}
if(lists.size()==2){
return mergeTwolists(lists.get(0),lists.get(1));
}
return mergeTwolists(mergeKlists1(lists.subList(0, lists.size()/2)),mergeKlists1(lists.subList(lists.size()/2, lists.size())));
}
//there exists some questions about heap, the result is wrong
public static ListNode mergeKlists2(List<ListNode> lists){
Heap h=new Heap(lists);
h.creatMinHeap();
ListNode result=null;
if(h.getlen()!=0){
result=h.getHeap();
}else{
return result;
}
ListNode temp=result;
while(h.getlen()!=0 && temp!=null){
temp.next=h.getHeap();
temp=temp.next;
}
return result;
}

//remove Nth node from end of list
public static ListNode getListNoderemove(ListNode head, int n){
ListNode start=new ListNode(0);
ListNode slow=start;
ListNode fast=start;
slow.next=head;

//move fast in front so that the gap between slow and fast becomes n
for(int i=1;i<=n+1;i++){
fast=fast.next;
}
//move fast to the end,maintaining the gap
while(fast!=null){
slow=slow.next;
fast=fast.next;
}
//skip the desired node
slow.next=slow.next.next;
return start.next;
}

//sort listnode by insert method
public static ListNode insertsort(ListNode head){
if(head==null){
return head;
}
//new start of the sorted list
ListNode helper=new ListNode(0);
//the node will be inserted
ListNode cur=head;
//insert ndoe between pre and pre.next
ListNode pre=helper;
//the next node will be inserted
ListNode next=null;
//not the end of input list
while(cur!=null){
next=cur.next;
//find the right place to insert
while(pre.next!=null && pre.next.val<cur.val){
pre=pre.next;
}
//insert between pre and pre.next
cur.next=pre.next;
pre.next=cur;
pre=helper;
cur=next;
}
return helper.next;
}

public static boolean isPalindeomr(ListNode head){
if(head==null || head.next==null){
return true;
}
ListNode start=new ListNode(0);
start.next=head;
ListNode firstHalfStart =head;
ListNode secondHalfStart = head;
ListNode fast=head;
//traverse to mid mode and reverse the first half of the Linkedlist in the same run
while(fast.next!=null && fast.next.next!=null){
fast=fast.next.next;

start.next=secondHalfStart.next;
secondHalfStart.next=secondHalfStart.next.next;
start.next.next=firstHalfStart;

firstHalfStart = start.next;
}
//offset for odd number of elements
//as the mid node is common to both halves, this should be shipped
if(fast.next==null){
firstHalfStart = firstHalfStart.next;
}
//at the end of the previous loop,secondHalfStart pointer is still stuck on the end of the first half
//shift it by one to take it to the start of the SecondHalf
secondHalfStart = secondHalfStart.next;

while(secondHalfStart!=null){
if(firstHalfStart.val!=secondHalfStart.val){
return false;
}
secondHalfStart = secondHalfStart.next;
firstHalfStart = firstHalfStart.next;
}
return true;
}

//remove duplicate node
public static ListNode deleteDuplicates(ListNode head){
ListNode dummy=new ListNode(0);
dummy.next=head;
ArrayList<Integer> al=new ArrayList<Integer>();
while(head!=null){
if(!al.contains(head.val)){
al.add(head.val);

}else{
head.next=head.next.next;
}
head=head.next;
}
return dummy.next;
}

public static ListNode deleteDuplicates1(ListNode head){
ListNode list=head;
while(list!=null){
if(list.next==null){
break;
}
if(list.val==list.next.val){
list.next=list.next.next;
}else{
list=list.next;
}
}
return head;
}

public static ListNode deleteDuplicates2(ListNode head){
if(head==null || head.next==null){
return head;
}
head.next=deleteDuplicates2(head.next);
return head.val==head.next.val?head.next:head;
}
//remove nodes that have duplicate numbers
public static ListNode deleteDuplicates3(ListNode head){
if(head==null||head.next==null){
return head;
}
//use two pointer,slow-track the node before the dup nodes
//fast-to find last node of dups
ListNode dummy=new ListNode(0);
ListNode fast=head;
ListNode slow=dummy;
slow.next=fast;
while(fast!=null){
while(fast.next!=null && fast.val==fast.next.val){
fast=fast.next;
}
if(slow.next!=fast){
slow.next=fast.next;
fast=slow.next;
}else{
slow=slow.next;
fast=fast.next;
}
}
return dummy.next;
}

//resort list
public static void resortlist(ListNode head){
if(head==null || head.next==null){
return;
}
//find the middle of the list
ListNode p1=head;
ListNode p2=head;
while(p2.next!=null && p2.next.next!=null){
p1=p1.next;
p2=p2.next.next;
}
//reverse the half after middle 1->2->3->4->5->6 1->2->3->6->5->4
ListNode premiddle=p1;
ListNode preCurrent=p1.next;
while(preCurrent.next!=null){
ListNode current=preCurrent.next;
preCurrent.next=current.next;
current.next=premiddle.next;
premiddle.next=current;
}
//start reorder one by one 1->2->3->4->5->6 1->6->2->5->3->4
p1=head;
p2=premiddle.next;
while(p1!=premiddle){
premiddle.next=p2.next;
p2.next=p1.next;
p1.next=p2;
p1=p2.next;
p2=premiddle.next;
}
}

public static ListNode recordNodes1(ListNode head){
if(head==null||head.next==null){
return head;
}
Deque<ListNode> stack=new ArrayDeque<ListNode>();
ListNode ptr=head;
while(ptr!=null){
stack.push(ptr);
ptr=ptr.next;
}
int cnt=(stack.size()-1)/2;
ptr=head;
while(cnt-->0){
ListNode top=stack.pop();
ListNode tmp=ptr.next;
ptr.next=top;
top.next=tmp;
ptr=tmp;
}
stack.pop().next=null;
return head;
}

//swap nodes in pairs
public static ListNode SwapNodes(ListNode head){
ListNode start=new ListNode(0);
start.next=head;
ListNode current=start;
while((current.next!=null) && (current.next.next!=null)){
ListNode first=current.next;
ListNode second=current.next.next;
first.next=second.next;
current.next=second;
current.next.next=first;
current=current.next.next;
}
return start.next;
}

//odd even linked list
public static ListNode getoddlist(ListNode head){
if(head==null || head.next==null){
return head;
}

ListNode p1=head;
ListNode p2=head.next;
ListNode p2start=p2;
while(p1!=null){
p1.next=p1.next.next;
p1=p1.next;
}
// while(p2.next!=null){
// p2.next=p2.next.next;
// p2=p2.next;
// }
//p1.next=p2start;
return head;
}

public static ListNode oddEvevList(ListNode head){
if(head==null){
return head;
}
ListNode odd=head;
ListNode even=head.next;
ListNode evenhead=even;
while(even!=null && even.next!=null){
odd.next=odd.next.next;
even.next=even.next.next;
odd=odd.next;
even=even.next;
}
odd.next=evenhead;
return head;


public static ListNode oddEvenList1(ListNode head){
if(head==null||head.next==null||head.next.next==null){
return head;
}
ListNode odd=head;
ListNode even=head.next;
ListNode even1=head.next;
while(even!=null && even.next!=null){
odd.next=even.next;
odd=odd.next;
even.next=odd.next;
even=even.next;
}
odd.next=even1;
return head;
}


//remove linked list element
public static ListNode removenode(ListNode head,int val){
if(head==null){
return head;
}
ListNode fakehead=new ListNode(0);
fakehead.next=head;
ListNode curr=head;
ListNode prev=fakehead;
while(curr!=null){
if(curr.val==val){
prev.next=curr.next;
}else{
prev=prev.next;
}
curr=curr.next;
}
return fakehead.next;
}

public static ListNode removeElements1(ListNode head,int val){
while(head!=null && head.val==val){
head=head.next;
}
ListNode cur=head;
while(cur!=null && cur.next!=null){
if(cur.next.val==val){
cur.next=cur.next.next;
}else{
cur=cur.next;
}

}
return head;
}

//rotate right
public static ListNode rotateright(ListNode head,int n){
if(head==null||head.next==null){
return head;
}
ListNode dummy=new ListNode(0);
dummy.next=head;
ListNode fast=dummy;
ListNode slow=dummy;
//get length of ListNode
int i=0;
for(i=0;fast.next!=null;i++){
fast=fast.next;
}
// while(head!=null){
// i++;
// head=head.next;
// }
//get the i-n%i th node
for(int j=i-n%i;j>0;j--){
slow=slow.next;
}
//do the rotate
fast.next=dummy.next;
dummy.next=slow.next;
slow.next=null;
return dummy.next; 
}

//reverse linked list from position m to n
public static ListNode reverseinrange(ListNode head,int m,int n){
if(head==null){
return head;
}
ListNode dummy=new ListNode(0);
dummy.next=head;
//pre refer to m-1 th node
ListNode pre=dummy;
for(int i=0;i<m-1;i++){
pre=pre.next;
}
//start refer to m th node
ListNode start=pre.next;
// a pointer to a node that will be reversed
ListNode then=start.next;
for(int i=0;i<n-m;i++){
start.next=then.next;
then.next=pre.next;
pre.next=then;
then=start.next;
}
return dummy.next;
}
//partition list
public static ListNode partition(ListNode head, int x){
ListNode smallerhead=new ListNode(0);
ListNode biggerhead=new ListNode(0);
ListNode smaller=smallerhead;
ListNode bigger=biggerhead;
while(head!=null){
if(head.val<x){
smaller.next=head;
   smaller=smaller.next;
}else{
bigger.next=head;
bigger=bigger.next;
}
head=head.next;
}
//no need for extra check because of fake heads
smaller.next=biggerhead.next;
bigger.next=null;
return smallerhead.next;
}
//reverse node in k groups
public static ListNode reverseKGroup(ListNode head,int k){
ListNode curr=head;
int count=0;
//find the k+1 node
while(curr!=null&& count!=k){
curr=curr.next;
count++;
}
if(count==k){
curr=reverseKGroup(curr,k);
//head: head-pointer to direct part
//curr:head-pointer to reversed part
while(count-->0){
ListNode tmp=head.next;
head.next=curr;
curr=head;
head=tmp;
}
head=curr;
}
return head;
}

public static ListNode reverseKGroup1(ListNode head, int k){
ListNode begin;
if(head==null||head.next==null||k==1){
return head;
}
ListNode dummyhead=new ListNode(-1);
dummyhead.next=head;
begin=dummyhead;
int i=0;
while(head!=null){
i++;
if(i%k==0){
begin=reversefromstarttoend(begin,head.next);
head=head.next;
}else{
head=head.next;
}
}
return dummyhead.next;
}
public static ListNode reversefromstarttoend(ListNode begin, ListNode end){
ListNode curr=begin.next;
ListNode next,first;
ListNode prev=begin;
first=curr;
while(curr!=end){
next=curr.next;
curr.next=prev;
prev=curr;
curr=next;
}
begin.next=prev;
first.next=curr;
return first;
}
}


class Heap{
public List<ListNode> heap;
private int getLimit(){
return heap.size()-1;
}
Heap(List<ListNode> lists){
heap=new ArrayList<ListNode>();
heap.add(new ListNode(0));
int i=0;
while(i<lists.size()){
if(lists.get(i)!=null){
heap.add(lists.get(i));
}
++i;
}
}
public void heapAdjust(int n,int m){
ListNode value=new ListNode(0);
copy(heap.get(n),value);
for(int i=2*n;i<=m;i*=2){
if(i<m && heap.get(i).val>heap.get(i+1).val){
i++;
}
if(heap.get(i).val>value.val){
break;
}
copy(value,heap.get(n));
n=i;
}
copy(value,heap.get(n));
}

private void copy(ListNode s,ListNode t){
if(s==null){
s=new ListNode(t.val);
}
t.next=s.next;
t.val=s.val;
}
public void creatMinHeap(){
for(int i=getLimit()/2;i>0;--i){
heapAdjust(i,getLimit());
}
}
public ListNode getHeap(){
if(heap.size()==1){
return null;
}
if(heap.get(1)==null){
return null;
}
ListNode result =new ListNode(0);
copy(heap.get(1),result);
if(heap.get(1).next!=null){
copy(heap.get(1).next,heap.get(1));
}else{
copy(heap.get(heap.size()-1),heap.get(1));
heap.remove(heap.size()-1);
}
if(heap.size()!=1){
heapAdjust(1,getLimit());
}
return result;
}
public int getlen(){
return heap.size()-1;
}
}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
完整版:https://download.csdn.net/download/qq_27595745/89522468 【课程大纲】 1-1 什么是java 1-2 认识java语言 1-3 java平台的体系结构 1-4 java SE环境安装和配置 2-1 java程序简介 2-2 计算机中的程序 2-3 java程序 2-4 java类库组织结构和文档 2-5 java虚拟机简介 2-6 java的垃圾回收器 2-7 java上机练习 3-1 java语言基础入门 3-2 数据的分类 3-3 标识符、关键字和常量 3-4 运算符 3-5 表达式 3-6 顺序结构和选择结构 3-7 循环语句 3-8 跳转语句 3-9 MyEclipse工具介绍 3-10 java基础知识章节练习 4-1 一维数组 4-2 数组应用 4-3 多维数组 4-4 排序算法 4-5 增强for循环 4-6 数组和排序算法章节练习 5-0 抽象和封装 5-1 面向过程的设计思想 5-2 面向对象的设计思想 5-3 抽象 5-4 封装 5-5 属性 5-6 方法的定义 5-7 this关键字 5-8 javaBean 5-9 包 package 5-10 抽象和封装章节练习 6-0 继承和多态 6-1 继承 6-2 object类 6-3 多态 6-4 访问修饰符 6-5 static修饰符 6-6 final修饰符 6-7 abstract修饰符 6-8 接口 6-9 继承和多态 章节练习 7-1 面向对象的分析与设计简介 7-2 对象模型建立 7-3 类之间的关系 7-4 软件的可维护与复用设计原则 7-5 面向对象的设计与分析 章节练习 8-1 内部类与包装器 8-2 对象包装器 8-3 装箱和拆箱 8-4 练习 9-1 常用类介绍 9-2 StringBuffer和String Builder类 9-3 Rintime类的使用 9-4 日期类简介 9-5 java程序国际化的实现 9-6 Random类和Math类 9-7 枚举 9-8 练习 10-1 java异常处理 10-2 认识异常 10-3 使用try和catch捕获异常 10-4 使用throw和throws引发异常 10-5 finally关键字 10-6 getMessage和printStackTrace方法 10-7 异常分类 10-8 自定义异常类 10-9 练习 11-1 Java集合框架和泛型机制 11-2 Collection接口 11-3 Set接口实现类 11-4 List接口实现类 11-5 Map接口 11-6 Collections类 11-7 泛型概述 11-8 练习 12-1 多线程 12-2 线程的生命周期 12-3 线程的调度和优先级 12-4 线程的同步 12-5 集合类的同步问 12-6 用Timer类调度任务 12-7 练习 13-1 Java IO 13-2 Java IO原理 13-3 流类的结构 13-4 文件流 13-5 缓冲流 13-6 转换流 13-7 数据流 13-8 打印流 13-9 对象流 13-10 随机存取文件流 13-11 zip文件流 13-12 练习 14-1 图形用户界面设计 14-2 事件处理机制 14-3 AWT常用组件 14-4 swing简介 14-5 可视化开发swing组件 14-6 声音的播放和处理 14-7 2D图形的绘制 14-8 练习 15-1 反射 15-2 使用Java反射机制 15-3 反射与动态代理 15-4 练习 16-1 Java标注 16-2 JDK内置的基本标注类型 16-3 自定义标注类型 16-4 对标注进行标注 16-5 利用反射获取标注信息 16-6 练习 17-1 顶目实战1-单机版五子棋游戏 17-2 总体设计 17-3 代码实现 17-4 程序的运行与发布 17-5 手动生成可执行JAR文件 17-6 练习 18-1 Java数据库编程 18-2 JDBC类和接口 18-3 JDBC操作SQL 18-4 JDBC基本示例 18-5 JDBC应用示例 18-6 练习 19-1 。。。
完整版:https://download.csdn.net/download/qq_27595745/89522468 【课程大纲】 1-1 什么是java 1-2 认识java语言 1-3 java平台的体系结构 1-4 java SE环境安装和配置 2-1 java程序简介 2-2 计算机中的程序 2-3 java程序 2-4 java类库组织结构和文档 2-5 java虚拟机简介 2-6 java的垃圾回收器 2-7 java上机练习 3-1 java语言基础入门 3-2 数据的分类 3-3 标识符、关键字和常量 3-4 运算符 3-5 表达式 3-6 顺序结构和选择结构 3-7 循环语句 3-8 跳转语句 3-9 MyEclipse工具介绍 3-10 java基础知识章节练习 4-1 一维数组 4-2 数组应用 4-3 多维数组 4-4 排序算法 4-5 增强for循环 4-6 数组和排序算法章节练习 5-0 抽象和封装 5-1 面向过程的设计思想 5-2 面向对象的设计思想 5-3 抽象 5-4 封装 5-5 属性 5-6 方法的定义 5-7 this关键字 5-8 javaBean 5-9 包 package 5-10 抽象和封装章节练习 6-0 继承和多态 6-1 继承 6-2 object类 6-3 多态 6-4 访问修饰符 6-5 static修饰符 6-6 final修饰符 6-7 abstract修饰符 6-8 接口 6-9 继承和多态 章节练习 7-1 面向对象的分析与设计简介 7-2 对象模型建立 7-3 类之间的关系 7-4 软件的可维护与复用设计原则 7-5 面向对象的设计与分析 章节练习 8-1 内部类与包装器 8-2 对象包装器 8-3 装箱和拆箱 8-4 练习 9-1 常用类介绍 9-2 StringBuffer和String Builder类 9-3 Rintime类的使用 9-4 日期类简介 9-5 java程序国际化的实现 9-6 Random类和Math类 9-7 枚举 9-8 练习 10-1 java异常处理 10-2 认识异常 10-3 使用try和catch捕获异常 10-4 使用throw和throws引发异常 10-5 finally关键字 10-6 getMessage和printStackTrace方法 10-7 异常分类 10-8 自定义异常类 10-9 练习 11-1 Java集合框架和泛型机制 11-2 Collection接口 11-3 Set接口实现类 11-4 List接口实现类 11-5 Map接口 11-6 Collections类 11-7 泛型概述 11-8 练习 12-1 多线程 12-2 线程的生命周期 12-3 线程的调度和优先级 12-4 线程的同步 12-5 集合类的同步问 12-6 用Timer类调度任务 12-7 练习 13-1 Java IO 13-2 Java IO原理 13-3 流类的结构 13-4 文件流 13-5 缓冲流 13-6 转换流 13-7 数据流 13-8 打印流 13-9 对象流 13-10 随机存取文件流 13-11 zip文件流 13-12 练习 14-1 图形用户界面设计 14-2 事件处理机制 14-3 AWT常用组件 14-4 swing简介 14-5 可视化开发swing组件 14-6 声音的播放和处理 14-7 2D图形的绘制 14-8 练习 15-1 反射 15-2 使用Java反射机制 15-3 反射与动态代理 15-4 练习 16-1 Java标注 16-2 JDK内置的基本标注类型 16-3 自定义标注类型 16-4 对标注进行标注 16-5 利用反射获取标注信息 16-6 练习 17-1 顶目实战1-单机版五子棋游戏 17-2 总体设计 17-3 代码实现 17-4 程序的运行与发布 17-5 手动生成可执行JAR文件 17-6 练习 18-1 Java数据库编程 18-2 JDBC类和接口 18-3 JDBC操作SQL 18-4 JDBC基本示例 18-5 JDBC应用示例 18-6 练习 19-1 。。。
完整版:https://download.csdn.net/download/qq_27595745/89522468 【课程大纲】 1-1 什么是java 1-2 认识java语言 1-3 java平台的体系结构 1-4 java SE环境安装和配置 2-1 java程序简介 2-2 计算机中的程序 2-3 java程序 2-4 java类库组织结构和文档 2-5 java虚拟机简介 2-6 java的垃圾回收器 2-7 java上机练习 3-1 java语言基础入门 3-2 数据的分类 3-3 标识符、关键字和常量 3-4 运算符 3-5 表达式 3-6 顺序结构和选择结构 3-7 循环语句 3-8 跳转语句 3-9 MyEclipse工具介绍 3-10 java基础知识章节练习 4-1 一维数组 4-2 数组应用 4-3 多维数组 4-4 排序算法 4-5 增强for循环 4-6 数组和排序算法章节练习 5-0 抽象和封装 5-1 面向过程的设计思想 5-2 面向对象的设计思想 5-3 抽象 5-4 封装 5-5 属性 5-6 方法的定义 5-7 this关键字 5-8 javaBean 5-9 包 package 5-10 抽象和封装章节练习 6-0 继承和多态 6-1 继承 6-2 object类 6-3 多态 6-4 访问修饰符 6-5 static修饰符 6-6 final修饰符 6-7 abstract修饰符 6-8 接口 6-9 继承和多态 章节练习 7-1 面向对象的分析与设计简介 7-2 对象模型建立 7-3 类之间的关系 7-4 软件的可维护与复用设计原则 7-5 面向对象的设计与分析 章节练习 8-1 内部类与包装器 8-2 对象包装器 8-3 装箱和拆箱 8-4 练习 9-1 常用类介绍 9-2 StringBuffer和String Builder类 9-3 Rintime类的使用 9-4 日期类简介 9-5 java程序国际化的实现 9-6 Random类和Math类 9-7 枚举 9-8 练习 10-1 java异常处理 10-2 认识异常 10-3 使用try和catch捕获异常 10-4 使用throw和throws引发异常 10-5 finally关键字 10-6 getMessage和printStackTrace方法 10-7 异常分类 10-8 自定义异常类 10-9 练习 11-1 Java集合框架和泛型机制 11-2 Collection接口 11-3 Set接口实现类 11-4 List接口实现类 11-5 Map接口 11-6 Collections类 11-7 泛型概述 11-8 练习 12-1 多线程 12-2 线程的生命周期 12-3 线程的调度和优先级 12-4 线程的同步 12-5 集合类的同步问 12-6 用Timer类调度任务 12-7 练习 13-1 Java IO 13-2 Java IO原理 13-3 流类的结构 13-4 文件流 13-5 缓冲流 13-6 转换流 13-7 数据流 13-8 打印流 13-9 对象流 13-10 随机存取文件流 13-11 zip文件流 13-12 练习 14-1 图形用户界面设计 14-2 事件处理机制 14-3 AWT常用组件 14-4 swing简介 14-5 可视化开发swing组件 14-6 声音的播放和处理 14-7 2D图形的绘制 14-8 练习 15-1 反射 15-2 使用Java反射机制 15-3 反射与动态代理 15-4 练习 16-1 Java标注 16-2 JDK内置的基本标注类型 16-3 自定义标注类型 16-4 对标注进行标注 16-5 利用反射获取标注信息 16-6 练习 17-1 顶目实战1-单机版五子棋游戏 17-2 总体设计 17-3 代码实现 17-4 程序的运行与发布 17-5 手动生成可执行JAR文件 17-6 练习 18-1 Java数据库编程 18-2 JDBC类和接口 18-3 JDBC操作SQL 18-4 JDBC基本示例 18-5 JDBC应用示例 18-6 练习 19-1 。。。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值