This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List; | |
import java.util.stream.Stream; | |
import static java.util.stream.Collectors.toList; | |
public class Fibonacci { | |
/** | |
* Java 8 / Lambda approach to generate fibonacci series. | |
* Fibonacci always start as classic (e.g. 0, 1, 1, 2, 3, 5) | |
* @param series Number of how many fibonacci number should be generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List; | |
import java.util.stream.Stream; | |
import static java.util.stream.Collectors.toList; | |
class Armstrong { | |
/** | |
* /** | |
* Java 8 / Lambda approach to generate Armstrong number. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
public class BubbleSort { | |
public static int[] data = new int[]{1, 8, 2, 7, 3, 4, 7, 6}; | |
public static void main(String[] args) { | |
sort(); | |
System.out.println(Arrays.toString(data)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
public class Reverse { | |
private static int[] data = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; | |
public static void main(String[] args) { | |
reverse(); | |
System.out.println(Arrays.toString(data)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.util.stream.Stream; | |
import static java.util.stream.Collectors.toList; | |
public class SearchBreadthDepth { | |
/** | |
node5 | |
node3 node4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
public class QuickSort { | |
private static int[] data = new int[]{19, 43, 35, 20, 50, 47, 42, 43, 47, 47}; | |
public static void main(String[] args) { | |
System.out.println(Arrays.toString(data)); | |
sort(); | |
System.out.println(Arrays.toString(data)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SelectionSearch { | |
private static int[] data = new int[]{9, 1, 43, 5, 20, 50, 7, 22, 43, 17, 47}; | |
public static void main(String[] args) { | |
System.out.println(Arrays.toString(data)); | |
selectionSort(); | |
System.out.println(Arrays.toString(data)); | |
} | |
public static void selectionSort() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SelectionSearch { | |
private static int[] data = new int[]{9, 1, 43, 5, 20, 50, 7, 22, 43, 17, 47}; | |
public static void main(String[] args) { | |
System.out.println(Arrays.toString(data)); | |
insertionSort(); | |
System.out.println(Arrays.toString(data)); | |
} | |
public static void insertionSort() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
public class App { | |
public static void main(String[] args) { | |
List<Vertex> vertexList = new ArrayList<>(); | |
vertexList.add(new Vertex("A")); | |
vertexList.add(new Vertex("B")); | |
vertexList.add(new Vertex("C")); |
OlderNewer