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
package com.goharsha.benchmarks | |
import org.openjdk.jmh.annotations.* | |
import org.openjdk.jmh.infra.Blackhole | |
import java.util.concurrent.TimeUnit | |
import java.util.PriorityQueue | |
import kotlin.comparisons.compareByDescending | |
import kotlin.comparisons.thenBy |
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
package com.goharsha.android.utils | |
import androidx.lifecycle.LiveData | |
import androidx.lifecycle.MediatorLiveData | |
import androidx.lifecycle.Transformations | |
/** | |
* A utility to create a [LiveData] which will be giving out a [source] value manipulated with a | |
* [mapper] function. The difference between this function and [Transformations.map] is that this | |
* function additionally allows to set a [defaultValue] until the source starts producing. |
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
#include <stdio.h> | |
#include <stdlib.h> | |
void merge_sort(int*, int*, int); | |
void merge2(int* dest, int* a, int* b, int lenA, int lenB) { | |
// Array indices | |
int dI = 0, aI = 0, bI = 0; | |
// Copy the values from all the arrays |