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
package src; | |
import com.google.zxing.BarcodeFormat; | |
import com.google.zxing.EncodeHintType; | |
import com.google.zxing.WriterException; | |
import com.google.zxing.qrcode.QRCodeWriter; | |
import javax.imageio.ImageIO; | |
import java.awt.*; | |
import java.awt.image.BufferedImage; |
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
package Entity; | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import com.google.gson.JsonObject; | |
import com.thedeanda.lorem.LoremIpsum; | |
import org.jetbrains.annotations.Contract; | |
import org.jetbrains.annotations.NotNull; | |
import java.io.BufferedWriter; |
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
package com.thealgorithms.searches; | |
class PerfectBinarySearch { | |
static int binarySearch(int[] arr, int target) { | |
int low = 0; | |
int high = arr.length - 1; | |
while (low <= high) { | |
int mid = (low + high) / 2; |
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
package com.thealgorithms.others; | |
public class CountChar { | |
/** | |
* Count non space character in string | |
* | |
* @param str String to count the characters | |
* @return number of character in the specified string | |
*/ |
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
package com.thealgorithms.others; | |
import java.util.*; | |
/** | |
* Dijkstra's algorithm,is a graph search algorithm that solves the | |
* single-source shortest path problem for a graph with nonnegative edge path | |
* costs, producing a shortest path tree. | |
* | |
* <p> | |
* NOTE: The inputs to Dijkstra's algorithm are a directed and weighted graph |
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
package com.thealgorithms.others; | |
import java.util.Scanner; | |
/** | |
* Fibonacci sequence, and characterized by the fact that every number after the | |
* first two is the sum of the two preceding ones. | |
* | |
* <p> | |
* Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21,... |
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
package com.thealgorithms.strings; | |
/** | |
* Wikipedia: https://en.wikipedia.org/wiki/Palindrome | |
*/ | |
class Palindrome { | |
/** | |
* Check if a string is palindrome string or not using String Builder | |
* |
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
package com.thealgorithms.sorts; | |
import static com.thealgorithms.sorts.SortUtils.less; | |
/** | |
* Generic merge sort algorithm. | |
* | |
* @see SortAlgorithm | |
*/ | |
class MergeSort implements SortAlgorithm { |
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
package com.thealgorithms.others; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Random; | |
/** | |
* Creates a random password from ASCII letters Given password length bounds | |
* |
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
package com.thealgorithms.others; | |
import java.util.Scanner; | |
/** | |
* Fibonacci sequence, and characterized by the fact that every number after the | |
* first two is the sum of the two preceding ones. | |
* | |
* <p> | |
* Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21,... |
NewerOlder