-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLL.java
More file actions
46 lines (46 loc) · 967 Bytes
/
LL.java
File metadata and controls
46 lines (46 loc) · 967 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
34
35
36
37
38
39
40
41
42
43
44
45
46
//package com.abhi.Linkedlist;
//
//public class Linked {
//private Node head;
// private Node tail;
// private int size;
//
// LL(){
// this.size=0;
// }
//
//
// public void insertFirst(int val){
// Node node = new Node(val);
// node.next = head;
// head = node;
//
// if (tail == null) {
// tail = head;
// }
// size += 1;
// }
// public void insertLast(int val) {
// if (tail == null) {
// insertFirst(val);
// return;
// }
// Node node = new Node(val);
// tail.next = node;
// tail = node;
// size++;
// }
// private class Node {
// private int value;
// private Node next;
//
// public Node(int value) {
// this.value = value;
// }
//
// public Node(int value, Node next) {
// this.value = value;
// this.next = next;
// }
// }
//}