Realign a different indentation (#28409)
for the line of "Collections.sort(variable_nale);"
This commit is contained in:
		@@ -53,16 +53,19 @@ Since ArrayList implements *List*, an ArrayList can be created using the followi
 | 
				
			|||||||
  ```
 | 
					  ```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Modify/update element at specified index**
 | 
					**Modify/update element at specified index**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ```java
 | 
					  ```java
 | 
				
			||||||
  variable_name.set(index_number,element);
 | 
					  variable_name.set(index_number,element);
 | 
				
			||||||
  ```
 | 
					  ```
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
**Get the size of the list**
 | 
					**Get the size of the list**
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 ```java
 | 
					 ```java
 | 
				
			||||||
  variable_name.size();
 | 
					  variable_name.size();
 | 
				
			||||||
  ```
 | 
					  ```
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
**Get a sublist of the list**
 | 
					**Get a sublist of the list**
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 ```java
 | 
					 ```java
 | 
				
			||||||
  variable_name.subList(int fromIndex, int toIndex);
 | 
					  variable_name.subList(int fromIndex, int toIndex);
 | 
				
			||||||
  ```
 | 
					  ```
 | 
				
			||||||
@@ -80,11 +83,11 @@ Since ArrayList implements *List*, an ArrayList can be created using the followi
 | 
				
			|||||||
  ```
 | 
					  ```
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
**Sort elements in descending order**
 | 
					**Sort elements in descending order**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ```java
 | 
					  ```java
 | 
				
			||||||
  Collections.sort(variable_name, Collections.reverseOrder());
 | 
					  Collections.sort(variable_name, Collections.reverseOrder());
 | 
				
			||||||
  ```
 | 
					  ```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
**Creating Array from ArrayList**
 | 
					**Creating Array from ArrayList**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   ```java
 | 
					   ```java
 | 
				
			||||||
@@ -101,7 +104,6 @@ for(Object obj : arr) {
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
An ArrayList allows us to randomly access elements. ArrayList is similar to *Vector* in a lot of ways, but it is faster than Vectors. The main thing to note is that - Vectors are faster than arrays but ArrayLists are not. 
 | 
					An ArrayList allows us to randomly access elements. ArrayList is similar to *Vector* in a lot of ways, but it is faster than Vectors. The main thing to note is that - Vectors are faster than arrays but ArrayLists are not. 
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  
 | 
					 | 
				
			||||||
So when it comes down to choosing between the two - if speed is critical then Vectors should be considered, otherwise ArrayLists are better when it comes to storing large number of elements and accessing them efficiently.
 | 
					So when it comes down to choosing between the two - if speed is critical then Vectors should be considered, otherwise ArrayLists are better when it comes to storing large number of elements and accessing them efficiently.
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
 ## Basic Big O for ArrayList Methods:
 | 
					 ## Basic Big O for ArrayList Methods:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user