-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPnode.java
More file actions
33 lines (33 loc) · 709 Bytes
/
Copy pathPnode.java
File metadata and controls
33 lines (33 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* Created with IntelliJ IDEA.
* User: Manu
* Date: 11/10/13
* Time: 9:53 AM
* To change this template use File | Settings | File Templates.
*/
public class Pnode {
char ch;
int freq;
Pnode left,right,next;
Pnode(){
freq=ch='\0';
next=left=right=null;
}
Pnode(char ch,int freq,Pnode left,Pnode right){
this.ch=ch;
this.freq=freq;
this.left=left;
this.right=right;
this.next=null;
}
Pnode(Pnode t){
this.ch=t.ch;
this.freq=t.freq;
this.left=t.left;
this.right=t.right;
this.next=null;
}
public boolean isLeaf(){
return left==null && right == null;
}
};