CC4 Sorting & Queue Flashcards
Given a list of data FIND the location of a particular value or report that value is not present
Searching
A fundamental application for computers
Done to make finding data (searching) faster
Sorting
The data collection to be sorted is kept in the MAIN memory.
Internal Sorting
The sorting of data stored on secondary devices. Data is sorted in the main memory and written back to the SECONDARY DEVICE.
External Sorting
is the SIMPLEST iterative algorithm operates by comparing each item or element with the item next to it and swapping them if needed.
Bubble Sort
has achieved SLIGHTLY better performance and is efficient than bubble sort algorithm.
Selection Sort
Is a SIMPLE sorting algorithm that allows for efficient, in-place sorting of the array, one element at a time.
Insertion Sort
s a type of a DIVIDE AND CONQUER algorithm used to sort a given array; this means that the array is divided into halves and then further sub-divided till division can no longer take place.
Merge Sort
when size of UNSORTED LIST or portion of array is small use INSERTION SORT, OTHERWISE USE
Hybrid Sorts
(T)
Language libraries often have sorting algorithms in them
Java Arrays and Collections classes
C++ Standard Template Library
Python sort and sorted functions
(T)
Many other sorting algorithms exist.
is a special type of LinkedList. It is a FIFO (First-in, First-out) data structure. That is, the first element to be added will be the first element to be removed, and so forth.
Queue
three main operations:
enqueue, dequeue, and peek.
a LIST-LIKE STRUCTURE that provides restricted access to its elements.
Queues
(T)
In Queue, however an insertion must happen at one end that we call rear or tail of the queue and any removal must happen at the other end called front or end of the queue