Berikut source code programnya, ane menggunakan kompiler Java Netbeans:
public class Insertion_Sorting_TianChan {
public static void main(String[] args) {
int i;
int[] tian = {899,235,359,871,682,239,694,492,783,257,779,526,332,687,723,545,858,119,909,894,182,502,837,826,937,556,146,52,893,496,135,952,947,100,39,348,25,429,729,670,328,409,243,160,508,340,403,761,949,409,593,593,995,114,224,697,102,69,923,461,723,883,852,167,186,357,232,657,836,821,966,735,83,654,510,423,233,217,918,581,938,710,200,791,614,915,919,73,310,28,976,958,232,327,702,325,470,450,525,68,136,708,288,339,418,204,742,767,120,722,527,841,125,49,341,914,755,509,326,630,805,486,725,611,225,969,352,460,121,248,956,342,616,885,844,950,257,648,537,116,707,666,515,273,738,198,446,681,7,899,160,908,7,304,822,639,1,453,38,665,616,473,784,293,768,957,814,868,966,309,274,179,952,966,134,536,596,801,870,237,309,818,634,975,351,853,967,30,628,574,422,648,407,867,380,348,229,968,56,408,483,927,852,168,331,946,123,644,128,494,424,660,41,574,335,890,291,233,965,108,222,505,113,485,233,81,462,56,530,506,553,504,54,394,989,326,862,745,590,23,858,377,826,817,823,466,315,427,685,232,658,135,284,330,533,36,228,415,545,492,179,542,315,654,792,218,968,809,455,96,116,919,990,719,559,289,868,795,764,588,169,798,771,800,153,860,902,369,42,585,97,364,500,169,258,56,608,931,712,262,985,571,920,710,592,531,475,895,763,957,995,627,973,903,260,629,113,356,95,144,880,459,562,669,986,350,787,80,609,393,483,912,176,237,496,753,523,208,290,152,201,75,975,322,483,272,105,289,560,877,157,892,201,402,968,634,224,50,282,931,806,577,316,603,921,211,709,28,484,693,280,647,912,18,633,886,729,796,559,977,635,189,916,371,387,288,574,328,226,841,354,653,716,894,199,700,567,25,781,123,231,915,465,384,198,62,168,355,17,870,704,472,157,54,846,455,552,203,754,386,445,423,416,610,439,172,935,279,126,242,916,674,432,951,345,880,126,770,390,605,319,716,841,450,675,212,858,406,197,918,39,980,779,327,551,670,914,655,562,486,43,131,101,789,874,702,476,818,565,635,463,520,225,674,463,820,167,380,506,378,6,277,273,739,867,350,811,269,379,707,579,191,217,695,845,223,778,34,358,571,941,989,272,528,689,370,884,18,567,298,594,952,847,676,636,203,934,943,2,67,460,949,494,558,308,764,503,894,460,217,531,278,372,859,541,825,356,570,230,734,230,26,95,908,963,968,253,694,714,95,757,780,474,391,647,798,296,27,896,253,636,406,319,439,742,506,49,798,158,708,663,87,577,471,917,18,607,515,430,323,921,226,595,179,657,599,66,795,490,787,923,423,486,957,966,251,629,253,952,309,59,238,325,678,35,870,175,438,287,211,540,451,666,867,661,46,596,200,883,538,28,54,765,425,709,667,12,789,895,946,847,168,318,419,570,401,40,666,425,468,735,347,67,188,198,655,922,639,305,590,854,382,429,361,81,456,46,722,581,658,223,867,290,477,788,271,156,243,860,9,344,447,730,95,111,457,355,106,60,235,898,765,367,996,86,280,148,790,381,640,93,133,450,652,948,342,953,566,837,961,956,276,720,837,646,659,596,87,692,759,447,71,284,457,386,191,821,478,401,912,902,799,945,346,74,834,377,272,425,389,507,518,979,762,540,433,493,219,47,17,957,755,72,53,794,695,883,211,861,711,637,746,68,781,555,94,37,193,319,7,112,438,41,503,549,85,449,654,636,788,306,988,963,426,418,938,66,426,671,77,90,241,252,632,820,949,144,92,847,517,319,799,913,31,90,735,22,58,946,377,526,432,474,699,329,615,530,922,398,397,848,792,273,126,489,405,834,908,173,505,802,169,824,652,201,67,292,834,739,932,140,134,585,357,956,986,35,127,452,232,123,566,875,737,653,763,392,591,650,4,860,568,628,530,51,658,348,990,954,997,911,560,170,618,511,774,906,878,365,494,371,250,213,464,92,627,362,891,46,89,216,315,554,246,72,595,231,828,294,956,216,899,582,474,17,735,741,615,793,18,676,167,675,91,727,872,624,474,316,731,871,158,359,139,404,165,522,873,622,544,850,642,801,513,693,230,980,26,687,925,414,619,315,87,178,790,559,376,321,707,976,815,390,323,604,386,116,52,871,424,652,32,581,74,371,234,159,727,600,502,64,922,19,780,943,730,137,9,71,478,500,585,73,427,112,725,523,299,912,732,42,971,326,466,771,698,985,90,0,33,953,457,6,676,550,633,18,11,454,262};
urutkan(tian, tian.length);
System.out.println("SEPTIAN MAULANA");
System.out.println("1141177004039");
System.out.println("*** Tian Chan ***");
System.out.println();
System.out.println("Insertion Sorting");
System.out.println();
System.out.println("Sebelum Pengurutan Data = ");
System.out.println("899,235,359,871,682,239,694,492,783,257,779,526,332,687,723,545,858,119,909,894,182,502,837,826,937,556,146,52,893,496,135,952,947,100,39,348,25,429,729,670,328,409,243,160,508,340,403,761,949,409,593,593,995,114,224,697,102,69,923,461,723,883,852,167,186,357,232,657,836,821,966,735,83,654,510,423,233,217,918,581,938,710,200,791,614,915,919,73,310,28,976,958,232,327,702,325,470,450,525,68,136,708,288,339,418,204,742,767,120,722,527,841,125,49,341,914,755,509,326,630,805,486,725,611,225,969,352,460,121,248,956,342,616,885,844,950,257,648,537,116,707,666,515,273,738,198,446,681,7,899,160,908,7,304,822,639,1,453,38,665,616,473,784,293,768,957,814,868,966,309,274,179,952,966,134,536,596,801,870,237,309,818,634,975,351,853,967,30,628,574,422,648,407,867,380,348,229,968,56,408,483,927,852,168,331,946,123,644,128,494,424,660,41,574,335,890,291,233,965,108,222,505,113,485,233,81,462,56,530,506,553,504,54,394,989,326,862,745,590,23,858,377,826,817,823,466,315,427,685,232,658,135,284,330,533,36,228,415,545,492,179,542,315,654,792,218,968,809,455,96,116,919,990,719,559,289,868,795,764,588,169,798,771,800,153,860,902,369,42,585,97,364,500,169,258,56,608,931,712,262,985,571,920,710,592,531,475,895,763,957,995,627,973,903,260,629,113,356,95,144,880,459,562,669,986,350,787,80,609,393,483,912,176,237,496,753,523,208,290,152,201,75,975,322,483,272,105,289,560,877,157,892,201,402,968,634,224,50,282,931,806,577,316,603,921,211,709,28,484,693,280,647,912,18,633,886,729,796,559,977,635,189,916,371,387,288,574,328,226,841,354,653,716,894,199,700,567,25,781,123,231,915,465,384,198,62,168,355,17,870,704,472,157,54,846,455,552,203,754,386,445,423,416,610,439,172,935,279,126,242,916,674,432,951,345,880,126,770,390,605,319,716,841,450,675,212,858,406,197,918,39,980,779,327,551,670,914,655,562,486,43,131,101,789,874,702,476,818,565,635,463,520,225,674,463,820,167,380,506,378,6,277,273,739,867,350,811,269,379,707,579,191,217,695,845,223,778,34,358,571,941,989,272,528,689,370,884,18,567,298,594,952,847,676,636,203,934,943,2,67,460,949,494,558,308,764,503,894,460,217,531,278,372,859,541,825,356,570,230,734,230,26,95,908,963,968,253,694,714,95,757,780,474,391,647,798,296,27,896,253,636,406,319,439,742,506,49,798,158,708,663,87,577,471,917,18,607,515,430,323,921,226,595,179,657,599,66,795,490,787,923,423,486,957,966,251,629,253,952,309,59,238,325,678,35,870,175,438,287,211,540,451,666,867,661,46,596,200,883,538,28,54,765,425,709,667,12,789,895,946,847,168,318,419,570,401,40,666,425,468,735,347,67,188,198,655,922,639,305,590,854,382,429,361,81,456,46,722,581,658,223,867,290,477,788,271,156,243,860,9,344,447,730,95,111,457,355,106,60,235,898,765,367,996,86,280,148,790,381,640,93,133,450,652,948,342,953,566,837,961,956,276,720,837,646,659,596,87,692,759,447,71,284,457,386,191,821,478,401,912,902,799,945,346,74,834,377,272,425,389,507,518,979,762,540,433,493,219,47,17,957,755,72,53,794,695,883,211,861,711,637,746,68,781,555,94,37,193,319,7,112,438,41,503,549,85,449,654,636,788,306,988,963,426,418,938,66,426,671,77,90,241,252,632,820,949,144,92,847,517,319,799,913,31,90,735,22,58,946,377,526,432,474,699,329,615,530,922,398,397,848,792,273,126,489,405,834,908,173,505,802,169,824,652,201,67,292,834,739,932,140,134,585,357,956,986,35,127,452,232,123,566,875,737,653,763,392,591,650,4,860,568,628,530,51,658,348,990,954,997,911,560,170,618,511,774,906,878,365,494,371,250,213,464,92,627,362,891,46,89,216,315,554,246,72,595,231,828,294,956,216,899,582,474,17,735,741,615,793,18,676,167,675,91,727,872,624,474,316,731,871,158,359,139,404,165,522,873,622,544,850,642,801,513,693,230,980,26,687,925,414,619,315,87,178,790,559,376,321,707,976,815,390,323,604,386,116,52,871,424,652,32,581,74,371,234,159,727,600,502,64,922,19,780,943,730,137,9,71,478,500,585,73,427,112,725,523,299,912,732,42,971,326,466,771,698,985,90,0,33,953,457,6,676,550,633,18,11,454,262");
System.out.println();
System.out.println("Hasil Pengurutan Data = ");
tampilkan(tian, tian.length);
}
private static void tampilkan(int[] tian, int n) {
for (int i=0; i<n; i++)
System.out.print(tian[i]+" ");
System.out.println();
}
private static void urutkan(int[] tian, int n) {
int i, k;
int x;
boolean ketemu;
for (k=1; k<n; k++){
x = tian[k];
//Sisipkan X Kedalam Data [0 ... K-1]
i = k-1;
ketemu = false;
while ((i>=0)&&(!ketemu)){
if (x<tian[i]){
tian[i+1]=tian[i];
i--;
}
else
ketemu=true;
tian[i+1]=x;
}
}
}
}
Berikut hasil outputnya: