Skip to content

Instantly share code, notes, and snippets.

View mkdika's full-sized avatar
🎯
Focusing

Maikel mkdika

🎯
Focusing
View GitHub Profile
ARIES (21 Maret - 20 April)
TAURUS (21 April - Mei 20)
GEMINI (21 Mei - 20 Jun)
CANCER (21 Jun - 22 Jul)
LEO (23 Jul - 22 Aug)
@mkdika
mkdika / Runtime Complexity of Java Collections.md
Last active December 12, 2024 15:37
Runtime Complexity with Java Collection API Chart

This is base on Gist by Psayre23. I just improve some data and add my own notes regard to this topic.

Below are the Big O performance of common functions of different Java Collections.

List Add Remove Get Contains Next Size Data Structure
ArrayList O(1) O(n) O(1) O(n) O(1) O(1) Array
@mkdika
mkdika / ArrayForEach.java
Last active October 31, 2017 06:55
For vs For Each
public class ArrayForEach {
public static void main(String[] args) {
int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
// using regular FOR
for (int i = arr.length-1 ; i >= 0 ; i--) {
System.out.print(arr[i] + " ");
}
System.out.println("");
import java.util.Arrays;
/**
*
* @author Maikel Chandika <[email protected]>
*/
public class BubbleSortArrayType {
public static void main(String[] args) {
import java.util.Scanner;
/**
*
* @author Maikel Chandika <[email protected]>
*/
public class StringEquals {
public static void main(String[] args) {
import java.util.Scanner;
/**
*
* @author Maikel Chandika <[email protected]>
*/
public class Packinglist {
static String member;
static String alamatPengirim;
public class Paket {
String deskripsi;
boolean fragile;
double berat;
double total;
}
import java.util.Scanner;
public class MikeCoffee {
static String member, pengorder;
static Order[] orders;
public static void main(String[] args) {
Scanner entry = new Scanner(System.in);
@mkdika
mkdika / README.md
Created June 5, 2018 04:47 — forked from joyrexus/README.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@mkdika
mkdika / FibonacciStream.java
Created June 22, 2018 02:22
Fibonacci value n position with Java 8 Stream API
package algorithms.streams;
import java.math.BigInteger;
import java.util.stream.Stream;
/**
*
* @author Maikel Chandika ([email protected])
*
* to calculate Fibonacci n position with Java 8 Stream API.