answersLogoWhite

0


Best Answer

You can sort an array with any method you want, but there is a built-in qsort function, declared in stdlib.h (see the attached link).

bubble sort, quick sort, insertion sort, merge sort, radix sort and lot more..

merge sort is the most efficient one..

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

An array is simply a contiguous block of memory that is divided up into one or more elements, where each element is of the same type and size, as determined by the type specified in the array declaration. Arrays may be single-dimension or multi-dimensional. Multiplying the dimensions together gives the total number of elements in the array, and multiplying by the element size gives the total size of the array in bytes. The array name is a reference to the start address of the array, which is also the start address of the first element in the array. Pointing to this address with a pointer of the same type as the elements within allows you to navigate the array as you see fit, or you can use the array subscript operator to specify any element within the array.

Arrays can be static (fixed size, allocated at compile time) or dynamic (variable size, allocated at runtime). Large, dynamic, multi-dimensional arrays are often implemented non-contiguously as a series of smaller arrays of the same size, and using small arrays of pointers (or pointer-to-pointer types) which point to each of the smaller arrays. This also allows any single-dimension array to be subdivided into a multi-dimensional array.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

An array is simply a contiguous block of memory containing two or more elements. There are two types of array: a static array which is allocated on the stack at compile time; and a dynamic array which is allocated on the heap at runtime. Both can be one-dimensional or multi-dimensional. A one-dimensional array can be likened to a row (or column) of chessboard squares, with as many squares as required to store all the elements. A multi-dimensional array is any array with two or more dimensions. A two-dimensional array can be likened to the whole chessboard, where any square can be identified by its row and column index. However the dimensions needn't be equal. A two-dimensional array can also be imagined as a one-dimensional array where every element is simply another one-dimensional array. Three-dimensional arrays can be likened to a cube, or as a one-dimensional array of two-dimensional arrays. A four-dimensional array can be linked to a one-dimensional array of three-dimensional arrays, and so on. Although every one-dimensional array must be allocated in contiguous memory, multi-dimensional arrays can be dynamically allocated so that each dimension is itself a separately allocated one-dimensional array of pointers to the next dimension, making it possible to allocate extremely large arrays over a series of smaller allocations rather than as a single contiguous block.

This answer is:
User Avatar

User Avatar

Learn bay

Lvl 8
2y ago

Types of Sorting Algorithms:

Quick Sort.

Bubble Sort.

Merge Sort.

Insertion Sort.

Selection Sort.

Heap Sort.

Radix Sort.

Bucket Sort.

To learn more about data science please visit- Learnbay.co

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Two types # Single dimention # Multi dimentional

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Followings are different type of arrany in C#,

1) Single-Dimensional Array

2) Multidimensional Array

3) Jagged Array (Array-of-Arrays)

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many types of sorting array in C programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What object is used to store a set of values in a single variable name?

In the simplest case, that would be an array. However, many programming languages also have other types of collections - single objects which, in turn, can contain several other objects.


In C programming a character variable can at a time store how many characters?

You can store one, however if you make a char array: char[50]; You can make a string out of your array of characters.


In Computer programming Why is it considered good programming practice to define the number of array items as a constant before declaring the array?

In computer programming, (1) When a number is needed several times in a program, it is good practice to give that number a name. (2) When a name refers to a number that will never change during a run of a program, it is good practice to declare it as a constant before using it. In most programming languages, we do not define the number of array items as a constant. In many programming languages, it is easy to add items to an array, and an array keeps track of the number of items it holds, which a program can access using something like "array.length" or "array.shape". However, in C and C++ programming, the programmer must define the size of the array at the time it is defined, and the array does not keep track of the number of items it contains. To not define your array would leave the program open to unchecked growth. "Capping" the array with an upper value ensures that, if something goes wrong, you will not crash the application or system. Also, capping the array will make debugging potentially easier. Capping requires using that number in several places, and so (1) tells us it is good practice to give that number a name. Since it is not possible(*) to change the size of an array in C or C++, the number that holds the number of items in the array will never change, and so (2) tells us it is good practice to declare it as a constant. (*) There are a few tricks one can do with malloc() and realloc() that have the same effect as resizing an array, although technically all those tricks merely create a new fixed-size array.


What types of data used in algorithm?

Whatever data you need. If you need the algorithm to operate with many different types of data, and you are programming in C++, you could use generic programming practices and use templates.


How do you sort an array of numbers?

Use a sorting algorithm. There are a bewildering number of sorting algorithms, both stable and unstable. To sort numbers, an unstable sort suffices. The algorithm you use will depend on how many numbers need to be sorted (a small or a large set), however a hybrid algorithm (a combination of two or more algorithms) can cater for both. Introsort (unstable) and timsort (stable) are the two most common hybrid sorting algorithms.

Related questions

How many Types of sorting algorithm?

ten types of soting algorithm


What object is used to store a set of values in a single variable name?

In the simplest case, that would be an array. However, many programming languages also have other types of collections - single objects which, in turn, can contain several other objects.


In C programming a character variable can at a time store how many characters?

You can store one, however if you make a char array: char[50]; You can make a string out of your array of characters.


Which is the best website for practicing programming?

w3schools has many tutorials for many different types of web programming language. breakinterview.com has some good questions for practice .


How do you Find the highest (maximum) and lowest (minimum) grades in an array?

You can get many example of"c programming" Reference:cprogramming-bd.com/c_page1.aspx# integer grades


In Computer programming Why is it considered good programming practice to define the number of array items as a constant before declaring the array?

In computer programming, (1) When a number is needed several times in a program, it is good practice to give that number a name. (2) When a name refers to a number that will never change during a run of a program, it is good practice to declare it as a constant before using it. In most programming languages, we do not define the number of array items as a constant. In many programming languages, it is easy to add items to an array, and an array keeps track of the number of items it holds, which a program can access using something like "array.length" or "array.shape". However, in C and C++ programming, the programmer must define the size of the array at the time it is defined, and the array does not keep track of the number of items it contains. To not define your array would leave the program open to unchecked growth. "Capping" the array with an upper value ensures that, if something goes wrong, you will not crash the application or system. Also, capping the array will make debugging potentially easier. Capping requires using that number in several places, and so (1) tells us it is good practice to give that number a name. Since it is not possible(*) to change the size of an array in C or C++, the number that holds the number of items in the array will never change, and so (2) tells us it is good practice to declare it as a constant. (*) There are a few tricks one can do with malloc() and realloc() that have the same effect as resizing an array, although technically all those tricks merely create a new fixed-size array.


What types of data used in algorithm?

Whatever data you need. If you need the algorithm to operate with many different types of data, and you are programming in C++, you could use generic programming practices and use templates.


Give the syntax to declare two dimensional array using array of pointers?

It is not possible to declare a two-dimensional array using an array of pointers in any programming language, but many programming languages support declarations of N-dimensional arrays of pointers.The exact syntax varies with the programming language, and requires support for N-dimensional arrays and pointers. In C, the following declares an array of pointer variables, each implemented as pointer to the generic type "void":void* array_1D[10];The type of the expression array_1D is "void * const."The following example expands on the previous one by declaring a two-dimensional array of "void" pointers:void* array_2D[10][20];The type of the expression array_2D is "void ** const."The last example declares a 3-dimensional array of "void" pointers, which can be seen as a 2-dimensional array of arrays of pointers:void* array_3D[10][20][30];


How do you sort an array of numbers?

Use a sorting algorithm. There are a bewildering number of sorting algorithms, both stable and unstable. To sort numbers, an unstable sort suffices. The algorithm you use will depend on how many numbers need to be sorted (a small or a large set), however a hybrid algorithm (a combination of two or more algorithms) can cater for both. Introsort (unstable) and timsort (stable) are the two most common hybrid sorting algorithms.


What are big big box stores?

stores that sell many types of items


How many data types can the elements of an array have?

Depends on your language. Assuming java: If you make it an Object[] then it can contain any object For primitive types you must either make a primitive type array, ie double[], char[] which can contain only those primitives, or creater an Object[] and use primitive wrapper objects ie java.lang.Integer etc.


What is an arrey and how many types of arrey in details?

An array is a data type that describes a collection of ordered variables and types of arrays include vector arrays and matrix arrays.