This file contains hidden or 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
$i = 0 | |
while ($true) { | |
[System.Windows.Forms.SendKeys]::SendWait("{F5}") | |
Start-Sleep -s 60 | |
$i++; | |
$text = "" | |
if ($i -eq 1) { |
This file contains hidden or 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.LinkedHashSet; | |
import java.util.Stack; | |
public class CombinationGenerator { | |
private void func3(int[] arr, Stack<Integer> stack, ArrayList<String> list, int j) { | |
if (j < arr.length) { | |
for (int value : arr) { | |
stack.push(value); | |
StringBuilder stringBuilder = new StringBuilder(); |
This file contains hidden or 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 javax.swing.*; | |
import java.math.BigDecimal; | |
import java.math.BigInteger; | |
import java.math.MathContext; | |
enum Calculation { | |
ADDITION, | |
SUBTRACTION, | |
MULTIPLICATION, | |
DIVISION |
This file contains hidden or 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.*; | |
class Neighbour { | |
public Node node; | |
public int weight; | |
Neighbour(Node node, int weight) { | |
this.node = node; | |
this.weight = weight; |
This file contains hidden or 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 QuickSort { | |
private int[] arr; | |
public QuickSort(int[] arr) { | |
this.arr = arr; | |
} | |
public int[] sort() { | |
quickSort(0, arr.length - 1); |
This file contains hidden or 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 MergeSort { | |
private final int[] arr; | |
public MergeSort(int[] arr) { | |
this.arr = arr; | |
} | |
public int[] sort() { | |
int start = 0; | |
int end = arr.length - 1; |
This file contains hidden or 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 MergeSort { | |
private final int[] arr; | |
public MergeSort(int[] arr) { | |
this.arr = arr; | |
} | |
public int[] sort() { | |
int start = 0; | |
int end = arr.length - 1; |
This file contains hidden or 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 BinarySearchRecursive { | |
public static int search(int[] arr, int start, int end, int num) { | |
if (end - start == 1) { | |
if (arr[start] == num) { | |
return start; | |
} else if (arr[end] == num) { | |
return end; | |
} else { | |
return -1; | |
} |
This file contains hidden or 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 BinarySearchIterative { | |
public static int search(int[] arr, int num) { | |
int start = 0; | |
int end = arr.length - 1; | |
while (true) { | |
if (end - start == 1) { | |
if (arr[start] == num) { | |
return start; | |
} else if (arr[end] == num) { |
This file contains hidden or 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 RabinKarpAlgorithm { | |
private static long getNumber(char[] chars) { | |
long number = 0; | |
for (char ch: chars) { | |
number = (number * 10) + ((int) ch - (int)'a' + 1); | |
} | |
return number; |
NewerOlder