Algorithms arranged in data structures & algorithms
Sorting is to arrange data in a specific format. In computer science, sorting algorithms determine how to arrange data in a certain order. Sorted in order here is arranged in numeric or alphabetical order as in the dictionary.
The importance of arranging data is: finding data can be optimal if the data is arranged in a certain order (increase or decrease). Arrangements are also used to represent data in a more readable format.
In-place and Not-in-place arrangement algorithms
Arrangement algorithms may need to add some extra memory for comparison and temporary memory to store some data elements.
Algorithms that do not require any extra memory and the arrangement is carried out in the previously declared memory section (eg in an array for example) is called in-place sorting. An example of this sort of algorithm is the bubble sorting algorithm (bubble sorting).
But in some sort algorithms, the program needs to add the amount of memory that can be greater than or equal to the number of elements being sorted. These algorithms are called not-in-place sorting. For example, this sort of algorithm is merge sort.
Algorithm of fixed arrangement and comparison arrangement
A sorting algorithm is called a fixed arrangement if, after conducting the alignment, the relative position between equal elements is not changed.
An algorithm is called comparative sort if in the process of performing the algorithm we proceed to compare the keys and swap elements for each other. That is, the relative position of equal elements is changed.
Adaptive and Non-Adaptive Alignment algorithms
An algorithm is considered as an adaptive, if it takes advantage of the sorted elements in the list that has been sorted. That is, while sorting if the initial list has some sorted elements, the adaptive form algorithm will record these elements and will try not to change their order.
In contrast to the above algorithm, the non-adaptive algorithm does not record previously arranged elements. This type of algorithm will try to rearrange each element in the original list.
Important concepts in sorting algorithms
Below is a brief introduction to some of the concepts that appear while discussing sorting algorithms:
Order increases
A range of values is considered as in increasing order if the following element is larger than the preceding element. Examples: 1, 3, 5, 6, 9.
Order decreased
A range of values is treated as in descending order if the following element is smaller than the preceding element. Examples: 9, 6, 5, 3, 1.
Order does not increase
A range of values is considered as in the order that does not increase if the following element is smaller than or equal to the preceding element. Examples: 9, 6, 5, 5, 1. This type of order appears when in a sequence that contains the same values (in the example is 5).
Order does not decrease
A range of values that are considered as in order does not decrease if the following element is greater than or equal to the preceding element. Examples: 1, 5, 5, 6, 9. This type of order appears when in a sequence containing the same values (in the example is 5).
According to Tutorialspoint
Previous article: Hash Table data structure
Next lesson: Bubble Sort algorithm (Bubble Sort)
You should read it
- Greedy Algorithm (Greedy Algorithm)
- Insert algorithm (Insertion Sort)
- 4 applications that automatically arrange Windows files should not be ignored
- Selection sort algorithm (Selection Sort)
- WhatsApp will test new algorithms for Status sort feature
- How to Quick Sort an Array in C++
- What is algorithm?
- How to organize Windows files using both SSD and HDD
May be interested
- Heap data structuredata structure the heap is a special case of a balanced binary tree data structure, where the root node's key is compared to its children and arranged accordingly.
- WhatsApp will test new algorithms for Status sort featurewhatsapp is planning an experiment that could lead to a major change to one of the most popular features on its platform.
- What is algorithm?algorithms (also known as algorithms - english is algorithms) is a finite set of instructions to be executed in a certain order to get the desired result. in general, the algorithm is independent of programming languages, ie an algorithm can be deployed in many different programming languages.
- New algorithms to increase the accuracy of CAPTCHAthe new algorithm system has been developed to increase the accuracy of google service usage, against google machines and fraudulent computer programs.
- Array (Array) in C / C ++c / c ++ programming language provides data structures called arrays, stored in a set of data of the same type with fixed length. an array is used to store data sets, but it is useful if you think of an array of variables with the same type.
- Consolidating the ambition of self-driving cars, Intel plans to spend billions on acquiring Moovit trip planning applicationwith 800 million users worldwide, moovit's data and algorithms can be a powerful support to the self-driving car technology that intel is building.
- Data modeling in MongoDBdata in mongodb has a flexible schema. documents in the same collection need not have the same set of fields or structures, and common fields in collection documents can keep different data types.
- Algorithms predicting human faces change over time, helping to find missing peoplethe algorithm that predicts people's face changes over time will surely become a useful tool for finding lost relatives. invite you to find out!
- 3 free tools to keep track of Google update algorithms every dayto know when google algorithms are updated, we need to use some tracking tools by analyzing the ranking of tools and search results for thousands of websites and top keywords. here are 3 free tools to help you track changes in google algorithms.
- Environment settings in Data structuresbecause c and c ++ languages are the languages that almost every university uses to teach, in this chapter i will guide you to install c and c ++ to run the examples in the configuration series. structure and algorithm.