42 Questions
Na kojem principu radi bubble sort?
Najgori slučaj kod bubble sorta je
Insertion sort radi tako da se uzme ______ član nesortiranog dijela niza i postavi _________________ u sortiranom dijelu niza.
Bubble sort ima manju apriornu složenost od insertion sorta.
False
Položaj elemenata niza je bitan za učinkovitost insertion sorta
True
Za koji algoritam sortiranja se koristi pojam k – sortiranog niza (k je korak)?
shell
Insertion sort je bolji od bubble sorta na nizu do 100.000 elemenata
False
Od sortova složenosti O(n^2) na nizu do 100.000 elemenata najbolji od ponuđenih je
shell
Merge i quick sort koriste princip
Složenost merge sorta je O(nlog2n).
False
Najbolji slučaj merge sorta je već sortiran niz
False
Koji je do sada najbrži poznati algoritam sortiranja?
Izbor pivota kod quick sorta nije jednoznačan.
False
Merge sort je zbog složenosti O(nlogn) brži za izvođenje od quick sorta.
False
Šta je indirektno sortiranje?
Šta je stog?
Stog koristi FIFO princip
False
Kako se rješava problem punog stoga?
Linearna lista realizirana kao dinamička struktura podataka sadrži
pokazivač na prvi član liste i proizvoljan broj atoma
Svaki atom linearne liste sadrži polja sa
vrijednosti člana liste i pokazivača na sljedeći član
Dinamička linearna lista znači da
se lista zauzima i oslobađa memoriju po potrebi
Na kojem principu radi bubble sort?
Najgori slučaj kod bubble sorta je
Insertion sort radi tako da se uzme ______ član nesortiranog dijela niza i postavi _________________ u sortiranom dijelu niza.
Bubble sort ima manju apriornu složenost od insertion sorta.
True
Položaj elemenata niza je bitan za učinkovitost insertion sorta
True
Za koji algoritam sortiranja se koristi pojam k – sortiranog niza (k je korak)?
shell
Insertion sort je bolji od bubble sorta na nizu do 100.000 elemenata
True
Od sortova složenosti O(n^2) na nizu do 100.000 elemenata najbolji od ponuđenih je
shell
Merge i quick sort koriste princip
Složenost merge sorta je O(nlog2n).
True
Najbolji slučaj merge sorta je već sortiran niz
True
Koji je do sada najbrži poznati algoritam sortiranja?
Izbor pivota kod quick sorta nije jednoznačan.
True
Merge sort je zbog složenosti O(nlogn) brži za izvođenje od quick sorta.
True
Šta je indirektno sortiranje?
Šta je stog?
Stog koristi FIFO princip
True
Kako se rješava problem punog stoga?
Linearna lista realizirana kao dinamička struktura podataka sadrži
pokazivač na prvi član liste i proizvoljan broj atoma
Svaki atom linearne liste sadrži polja sa
vrijednosti člana liste i pokazivača na sljedeći član
Dinamička linearna lista znači da
se lista zauzima i oslobađa memoriju po potrebi
Study Notes
Sorting Algorithms
- Bubble sort operates on the principle of iterating through an array, comparing adjacent elements and swapping them if they are in the wrong order.
- The worst-case scenario for bubble sort is when the array is reverse sorted.
- Insertion sort works by taking an element from the unsorted part of the array and placing it in the correct position in the sorted part of the array.
- Bubble sort has a lower apriori complexity than insertion sort.
- The position of elements in the array is crucial for the efficiency of insertion sort.
- For arrays up to 100,000 elements, insertion sort is better than bubble sort.
- Among O(n^2) complexity sorts for arrays up to 100,000 elements, the best is insertion sort.
Merge and Quick Sort
- Merge sort and quick sort use the divide and conquer principle.
- The complexity of merge sort is O(nlog2n).
- The best-case scenario for merge sort is when the array is already sorted.
- Quick sort's pivot selection is not unique.
- Merge sort is faster than quick sort due to its O(nlogn) complexity.
Stacks and Dynamic Data Structures
- Indirect sorting refers to sorting data that is not physically moved, but rather referenced through pointers.
- A stack uses the FIFO (First-In-First-Out) principle.
- A problem with a full stack is solved by allocating more memory or deallocating unused memory.
- A linear list implemented as a dynamic data structure contains a sequence of nodes.
- Each node in a linear list contains fields with a value and a reference to the next node.
- Dynamic linear list means that nodes can be dynamically allocated and deallocated as needed.
Test your knowledge of sorting algorithms with this quiz! Explore concepts like the performance of insertion sort, bubble sort, and merge sort on arrays of up to 100,000 elements, as well as the usage of k-sorted arrays. Additionally, identify the best-case scenario for merge sort.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free