Skip to content

Commit 6ff74f0

Browse files
committed
Added space before braces of functions
1 parent 3ec7627 commit 6ff74f0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/main/java/com/thealgorithms/datastructures/lists/SortedLinkedList.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class SortedLinkedList {
1717
private Node head;
1818
private Node tail;
1919

20-
public SortedLinkedList(){
20+
public SortedLinkedList() {
2121
this.head=null;
2222
this.tail=null;
2323
}
@@ -27,7 +27,7 @@ public SortedLinkedList(){
2727
*
2828
* @param value the value to be inserted
2929
*/
30-
public void insert(int value){
30+
public void insert(int value) {
3131
Node newNode = new Node(value);
3232
if (head == null) {
3333
this.head = newNode;
@@ -53,7 +53,7 @@ else if (value > tail.value) {
5353
/**
5454
* Displays the elements of the sorted linked list.
5555
*/
56-
public void display(){
56+
public void display() {
5757
System.out.println(this.toString());
5858
}
5959

@@ -63,7 +63,7 @@ public void display(){
6363
* @param value the value to be deleted
6464
* @return true if the element is found and deleted, false otherwise
6565
*/
66-
public boolean delete(int value){
66+
public boolean delete(int value) {
6767
if (this.head == null) {
6868
return false;
6969
}
@@ -91,7 +91,7 @@ else if (this.head.value == value) {
9191
* @param value the value to be searched
9292
* @return true if the element is found, false otherwise
9393
*/
94-
public boolean search(int value){
94+
public boolean search(int value) {
9595
Node temp = this.head;
9696
while (temp != null) {
9797
if (temp.value == value) {
@@ -116,7 +116,7 @@ public boolean isEmpty() {
116116
*
117117
* @return the minimum value
118118
*/
119-
public int minValue(){
119+
public int minValue() {
120120
return this.head.value;
121121
}
122122

@@ -125,7 +125,7 @@ public int minValue(){
125125
*
126126
* @return the maximum value
127127
*/
128-
public int maxValue(){
128+
public int maxValue() {
129129
return this.tail.value;
130130
}
131131

@@ -150,12 +150,12 @@ public class Node {
150150
public int value;
151151
public Node next;
152152

153-
public Node(){
153+
public Node() {
154154
this.value = 0;
155155
this.next= null;
156156
}
157157

158-
public Node(int value){
158+
public Node(int value) {
159159
this.value = value;
160160
this.next = null;
161161
}

0 commit comments

Comments
 (0)