A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/de/d40/shell__sort_8cpp_source.html below:

TheAlgorithms/C++: sorting/shell_sort.cpp Source File

5 int

* array =

new int

[size];

7

std::cout <<

"\nHow many numbers do want to enter in unsorted array : "

;

9

std::cout <<

"\nEnter the numbers for unsorted array : "

;

10 for

(

int

i = 0; i < size; i++) {

15 for

(

int

i = size / 2; i > 0; i = i / 2) {

16 for

(

int

j = i; j < size; j++) {

17 for

(

int

k = j - i;

k

>= 0;

k

=

k

- i) {

18 if

(array[k] < array[k + i]) {

21 int

temp = array[

k

+ i];

22

array[

k

+ i] = array[

k

];

30

std::cout <<

"\nSorted array : "

;

31 for

(

int

i = 0; i < size; ++i) {

32

std::cout << array[i] <<

"\t"

;

double k(double x)

Another test function.

int main()

Main function.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4