Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void push(int zahl){
- if (this.first == null)
- {
- // leere warteschlange
- this.first = new Node(zahl, null);
- // optional: wenn nicht so, dann muss else if fall geändert werden
- this.last = first;
- }
- else if (this.first == this.last) // alternativ, wenn oben last nicht = first gesetzt wird: this.last == null
- {
- this.last = new Node(zahl, null);
- this.first.setNext(this.last);
- }
- else
- {
- this.last.setNext(new Node(zahl, null));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement