Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package stackqueue;
- /**
- *
- * @author faldi
- */
- public class LinkedListNode {
- LinkedListNode next;
- LinkedListNode prev;
- int nrp, uts, uas;
- String nama;
- /* Constructor
- * set this.data into new_data
- * set this.prev into null
- * set this.next into null
- */
- LinkedListNode(int nrp, String nama, int uts, int uas) {
- this.nrp = nrp;
- this.nama = nama;
- this.uts = uts;
- this.uas = uas;
- this.prev = null;
- this.next = null;
- }
- /* set this.prev into other
- * if other is not null, set other.next into this
- */
- void set_prev(LinkedListNode other) {
- this.prev = other;
- if(other != null){
- other.next = this;
- }
- }
- /* set this.next into other
- * if other is not null, set other.prev into this
- */
- void set_next(LinkedListNode other) {
- this.next = other;
- if(other != null){
- other.prev = this;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement