Advertisement
Faldi767

asdasdsa

Nov 17th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package stackqueue;
  7.  
  8. /**
  9. *
  10. * @author faldi
  11. */
  12. public class LinkedListNode {
  13. LinkedListNode next;
  14. LinkedListNode prev;
  15. int nrp, uts, uas;
  16. String nama;
  17. /* Constructor
  18. * set this.data into new_data
  19. * set this.prev into null
  20. * set this.next into null
  21. */
  22. LinkedListNode(int nrp, String nama, int uts, int uas) {
  23. this.nrp = nrp;
  24. this.nama = nama;
  25. this.uts = uts;
  26. this.uas = uas;
  27. this.prev = null;
  28. this.next = null;
  29. }
  30. /* set this.prev into other
  31. * if other is not null, set other.next into this
  32. */
  33. void set_prev(LinkedListNode other) {
  34. this.prev = other;
  35. if(other != null){
  36. other.next = this;
  37. }
  38. }
  39. /* set this.next into other
  40. * if other is not null, set other.prev into this
  41. */
  42. void set_next(LinkedListNode other) {
  43. this.next = other;
  44. if(other != null){
  45. other.prev = this;
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement