자바 링크드리스트
본 자료는 2페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
해당 자료는 2페이지 까지만 미리보기를 제공합니다.
2페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

자바 링크드리스트에 대한 보고서 자료입니다.

목차

없음

본문내용

ewName))
{
if(listHead==i)
{
if(listHead==listTail)
{
listHead=null;
listTail=null;
}
listHead=i.right;
return 0;
}
else if(i==listTail)
{
listTail=null;
before.right = listTail;
return 0;
}
before.right = i.right;
next.left=i.left;
return 0;
}
}
return 0;
}
public void RightaddNode(String name, String phone, String address, String newName)
{
Node i;
Node next;
Node inNode = new Node(name, phone, address, null, null);
for(i=listHead; i!=null; i=i.right)
{
if(i.name.equals(newName))
{
if(i.name.equals(listTail.name))
{
addNode(name,phone,address);
}
else
{
next=i.right;
next.left = inNode;
inNode.right = next;
i.right = inNode;
inNode.left = i;
inNode.name = name;
inNode.phone = phone;
inNode.address = address;
}
}
}
}
public void LeftaddNode(String name, String phone, String address, String newName)
{
Node i;
Node before;
Node inNode = new Node(name, phone, address, null, null);
for(i=listHead; i!=null; i=i.right)
{
if(i.name.equals(newName))
{
if(i==listHead)
{
i.left = inNode;
inNode.right = i;
listHead=listHead.left;
inNode.name = name;
inNode.phone = phone;
inNode.address = address;
}
else
{
before=i.left;
before.right = inNode;
inNode.left = before;
inNode.right = i;
i.left=inNode;
inNode.name = name;
inNode.phone = phone;
inNode.address = address;
}
}
}
}
public void show()
{
Node i;
for(i=listHead; i!=null; i=i.right)
{
System.out.println();
System.out.println("이름 : " + i.name);
System.out.println("번호 : " + i.phone);
System.out.println("주소 : " + i.address);
System.out.println();
}
}
}

class Node
{
String name;
String phone;
String address;
Node left=null;
Node right =null;
public Node(String name, String phone, String address, Node left, Node right)
{
this.name = name;
this.phone = phone;
this.address = address;
this.left = left;
this.right = right;
}
}
  • 가격1,000
  • 페이지수8페이지
  • 등록일2011.10.31
  • 저작시기2011.9
  • 파일형식한글(hwp)
  • 자료번호#710626
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니