public class SortUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
siftDown(double[] arr,
int k,
int n)
To restore the max-heap condition when a node's priority is decreased.
|
static void |
siftDown(float[] arr,
int k,
int n)
To restore the max-heap condition when a node's priority is decreased.
|
static void |
siftDown(int[] arr,
int k,
int n)
To restore the max-heap condition when a node's priority is decreased.
|
static <T extends java.lang.Comparable<? super T>> |
siftDown(T[] arr,
int k,
int n)
To restore the max-heap condition when a node's priority is decreased.
|
static void |
siftUp(double[] arr,
int k)
To restore the max-heap condition when a node's priority is increased.
|
static void |
siftUp(float[] arr,
int k)
To restore the max-heap condition when a node's priority is increased.
|
static void |
siftUp(int[] arr,
int k)
To restore the max-heap condition when a node's priority is increased.
|
static <T extends java.lang.Comparable<? super T>> |
siftUp(T[] arr,
int k)
To restore the max-heap condition when a node's priority is increased.
|
static void |
swap(double[] arr,
int i,
int j)
Swap two positions.
|
static void |
swap(float[] arr,
int i,
int j)
Swap two positions.
|
static void |
swap(int[] arr,
int i,
int j)
Swap two positions.
|
static void |
swap(java.lang.Object[] arr,
int i,
int j)
Swap two positions.
|
public static void swap(int[] arr,
int i,
int j)
public static void swap(float[] arr,
int i,
int j)
public static void swap(double[] arr,
int i,
int j)
public static void swap(java.lang.Object[] arr,
int i,
int j)
public static void siftUp(int[] arr,
int k)
public static void siftUp(float[] arr,
int k)
public static void siftUp(double[] arr,
int k)
public static <T extends java.lang.Comparable<? super T>> void siftUp(T[] arr,
int k)
public static void siftDown(int[] arr,
int k,
int n)
public static void siftDown(float[] arr,
int k,
int n)
public static void siftDown(double[] arr,
int k,
int n)
public static <T extends java.lang.Comparable<? super T>> void siftDown(T[] arr,
int k,
int n)