Search
 
SCRIPT & CODE EXAMPLE
 

CPP

Shell-Sort C++

C/C++/Java
1  gap = X;
2  do
3  { ok = 1;
4  for (i = 1; i<= N – gap; i++)
5    if (A[i] > A[i+gap])
6    {  temp = A[i];
7       A[i] = A[i+gap];
8       A[i+gap] = temp;
9       ok = 0;
10   }
11 if (gap/2 > 1) gap=gap/2; else gap=1;
12 } while (ok == 0);
Comment

PREVIOUS NEXT
Code Example
Cpp :: C++ Vector Operation Change Elements 
Cpp :: A Program to check if strings are rotations of each other or not 
Cpp :: cpp substring 
Cpp :: pointer to pointer c++ 
Cpp :: find second largest number in array c++ 
Cpp :: how to set arrays as function parameters in c++ 
Cpp :: binary tree 
Cpp :: activity selection problem 
Cpp :: unordered_map in c++ 
Cpp :: map of maps c++ 
Cpp :: c++ overloading by ref-qualifiers 
Cpp :: fname from FString 
Cpp :: how atan work c++ 
Cpp :: even or odd program in c++ 
Cpp :: C++ Volume of a Cube 
Cpp :: uint16_t in c++ 
Cpp :: finding nth most rare element code in c++ 
Cpp :: strcmp in c++ header file 
Cpp :: const in c++ is same as globle in python 
Cpp :: print float up to 3 decimal places in c++ 
Cpp :: Types of Conversions- C++ 
Cpp :: softwareegg.courses4u 
Cpp :: cpp fread 
Cpp :: start google 
Cpp :: what does npl mean? 
Cpp :: KUNG FU HUSTLE 
Cpp :: C++ (.NET CLI) 
Cpp :: For auto map C 
Cpp :: inorder to postorder converter online 
Cpp :: c++ array access operator 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =