Skip to content

Instantly share code, notes, and snippets.

View drewdev02's full-sized avatar
🎯
Focusing

Andrew Rodriguez drewdev02

🎯
Focusing
  • Havana
View GitHub Profile
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;
@drewdev02
drewdev02 / File.java
Created March 10, 2023 23:42
Create txt
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;
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;
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
*/
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
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,...
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
*
package com.thealgorithms.sorts;
import static com.thealgorithms.sorts.SortUtils.less;
/**
* Generic merge sort algorithm.
*
* @see SortAlgorithm
*/
class MergeSort implements SortAlgorithm {
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
*
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,...