
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10744 Articles

AmitDiwan
276 Views
In Bitonic Sort, the comparision is in predefined sequence (Bitonic sequence), not dependent on the data to be sorted. Let us see an example for Bitonic Sort Java program −Example Live Demopublic class Demo{ void compare_swap(int my_arr[], int i, int j, int direction){ if ((my_arr[i] > my_arr[j] ... Read More

AmitDiwan
7K+ Views
Following is the program for Recursive Binary Search in Java −Example Live Demopublic class Demo{ int rec_bin_search(int my_arr[], int left, int right, int x){ if (right >= left){ int mid = left + (right - left) / 2; if ... Read More

AmitDiwan
236 Views
Following is an example for Anagram Substring Search in Java −Example Live Demopublic class Demo{ static final int max_val = 256; static boolean compare_vals(char my_arr_1[], char my_arr_2[]){ for (int i = 0; i < max_val; i++) if (my_arr_1[i] != my_arr_2[i]) ... Read More

AmitDiwan
265 Views
The Comb Sort in Java eliminates the smaller values situated to the end of the list and the inversions are removed oby by one. Let us see an example −Example Live Demoimport java.util.Arrays; public class Demo{ void comb_sort(int nums[]){ int len_gap = nums.length; float ... Read More

AmitDiwan
209 Views
The Counting Sort counts the number of objects having distinct key values. Let us see an example −Note − The below code can be used with negative numbers as well.Example Live Demoimport java.util.*; public class Demo{ static void count_sort(int[] arr){ int max_val = Arrays.stream(arr).max().getAsInt(); ... Read More

AmitDiwan
154 Views
The conditional operator (? :) leverages the output of one value (which is a bool) to decide which expression has to be evaluated next. Let us see an example −Example Live Demoimport java.io.*; public class Demo{ public static void main (String[] args){ Object my_obj = true ? ... Read More

AmitDiwan
873 Views
Sorting the elements of a list using lambda expression −Example Live Demoimport java.util.*; public class Demo{ public static void main(String[] args){ ArrayList my_arr = new ArrayList(); my_arr.add(190); my_arr.add(267); my_arr.add(12); my_arr.add(0); System.out.println("Before sorting, ... Read More

AmitDiwan
323 Views
The clear function is used to clear up the mapping between the key value pairs. This way, the ConcurrentHashMap mappings would be cleared.Syntaxpublic void clear()Let us see an example −Example Live Demoimport java.util.concurrent.ConcurrentHashMap; import java.util.*; public class Demo{ public static void main(String[] args){ Map my_map = new ... Read More

AmitDiwan
419 Views
The sleep functionThis sleep function is used to ensure that the currently executing thread goes to sleep for a specific amount of milliseconds which is passed as a parameter to the function. The thread stops executing for that number of milliseconds.Let us see an exampleExample Live Demoimport java.lang.*; public class Demo ... Read More

AmitDiwan
745 Views
JAR is a file format that helps in aggregating Java class file, along with its associated metadata and resources into a single file.Creation of a JAR file − The jar cf command can be used, where ‘cf’ means creating the file.jar cf jar_file_name files_to_compressOnce a jar file has been created, ... Read More