This file contains hidden or 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
namespace ConsoleApplication32 | |
{ | |
class Program | |
{ | |
static int c = 0; | |
public static void SortInsert(int[] a) | |
{ | |
int k = 0; | |
for (int i=1; i<a.Length; i++) |
This file contains hidden or 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
class Program | |
{ | |
static int c = 0; | |
public static void SortInsert(int[] a) | |
{ | |
int k = 0; | |
for (int i=1; i<a.Length; i++) | |
{ |
This file contains hidden or 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
static void Main(string[] args) | |
{ | |
//int[] b = new int[10] { 5, 6, 4, 8, 9, 0, 3, 7, 1, 2 }; | |
int[] b; | |
string s = Console.ReadLine(); | |
string[] str = s.Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries); | |
b = new int[str.Length]; | |
for (int i = 0; i < str.Length; i++) | |
b[i] = Convert.ToInt32(str[i]); | |
ShellSort(b); //Cортировки |
This file contains hidden or 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
public static void SortBinIns(int[] b) | |
{ | |
int k = 0; | |
for (int i = 1; i <b.Length; i++) | |
{ | |
int tmp = b[i], left = 0, right = i - 1; | |
while ((k++ >=0)&&(left <= right)) | |
{ | |
int m = (left + right) / 2; | |
if (tmp < b[m]) |
This file contains hidden or 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
public static void SortInsert(int[] a) | |
{ | |
int k = 0; | |
for (int i=1; i<a.Length; i++) | |
{ | |
int j = i - 1; | |
int tmp = a[i]; | |
while ((j >= 0) && (k++ >= 0) && (a[j] > tmp)) | |
a[j + 1]=a[j--]; |