42_PUSH_SWAP

Da continuare a fare free https://stackoverflow.com/questions/5134891/how-do-i-use-valgrind-to-find-memory-leaks

In computation, sorting is highly essential to access and manipulate data efficiently. High performance sorting algorithms have always been in demand so that computers may process data more quickly. Since the computer has become a vital tool in various domains of human life, the various researchers have investigated and presented numerous sorting algorithms to sort elements of list with minimal execution time and least space. As the volume of data increases, the urgency for efficient data processing algorithms also increases.

Computationally and memory-efficient algorithms for sorting have always been in demand for researchers and computational scientists. Data need to be sorted in the required manner to draw useful details i.e. list of top ‘n’ items with respect to the sale, ‘n’ devices connected with server as Internet of Things (IoT) or a list of top ‘n’ scientists with respect to their publications. In mathematical terms, sorting could be defined as: “Let input is {n1, n2, n3, ..., nn} Output of the given sequence should be in a form such that {n1 ≤ n2 ≤ n3 ≤ ...... nn}”.

Rearranging the data in some logical order is known as sorting. An efficient sorting algorithm could simplify the processing of data in two ways: First, by reducing the complexity of a given problem and secondly, by managing data efficiently. Sorting is necessary for several applications like businesses and scientific applications. Its largest application is database management system where queries of Structured Query Language (SQL) are used to rearrange the data frequently. These algorithms are also assist several programs, like compilers and editors. There are number of problems that require sorting algorithms that are used to solve either specific computational problem or routine life general problem. Sorting algorithms also assist the searching algorithms by making them efficient and simple. Although different data structures are used to implement the sorting algorithms, however, in respect to figure out the efficiency of a sorting algorithm, usually array and tree data structures are used. Sorting methods can also assist in designing and manipulating different data structures efficiently.

There are several factors that assist in determining the best algorithm for a particular application that may include the size of the dataset, the particular arrangement of given data, the underlying computer architecture, available computer resources, and class of sorting whether it is internal or external sorting. Designing a highly efficient sorting method has always been a challenging task.

The major focus of an efficient algorithm is the utilization of the least amount of resources or time needed for its execution. Performance estimation of sorting algorithms is generally done on the ground of four parameters: stability, adaptivity, time complexity and space complexity. If the order of input data matters, for sorting, the algorithm is known as the adaptive sorting algorithm.

© 2 mm: A new technique for sorting data (Abbas Mubarak, Sajid Iqbal, Tariq Naeem, Shafiq Hussain); © 2022 Elsevier B.V