sisestusmeetod
Sisestusmeetod, known in English as the insertion method, is a simple sorting algorithm. It works by dividing the input list into two parts: a sorted sublist and an unsorted sublist. Initially, the sorted sublist contains only the first element, and the rest of the list is unsorted. The algorithm then iteratively takes elements from the unsorted sublist and inserts them into their correct position within the sorted sublist. This process continues until all elements from the original list have been moved to the sorted sublist, resulting in a fully sorted list.
To insert an element, the algorithm compares it with the elements in the sorted sublist, starting from