MYTUTOR SUBJECT ANSWERS

339 views

Name several sort algorithms of an array, their working principles and their efficency.

Bubble sort (compare two elements and switch them if one of them is higher than other, depending on ordering preference), iterate over the whole array of elements. Efficency O(n2).

Insert sort, make a separate list, where you insert the elements in an ordered manner, that is start at the smallest element and go until an element that is bigger than the input or end of list and insert it before that. Efficency O(n2).

Selection sort, iterate over the whole array and find the smallest element, put it into start, then iterate from smallest +1, then smallest +2. Efficency O(n2).

Merge sort, split array into smaller arrays until size 1 is reached, then assume size 1 is sorted, then merge them while sorting, the sub arrays. Efficency O(n logn).

Quicksort. Select a pivot point, split all elements that are larger than that to one side, smaller to other, then put the pivot, where it belongs. After do it on smaller arrays, when all is done, the arrays are merged and the final array is sorted. Efficency O(n logn).  

Egidijus S. IB Computing tutor, IB Maths tutor

1 year ago

Answered by Egidijus, who has applied to tutor IB Computing with MyTutor

Still stuck? Get one-to-one help from a personally interviewed subject specialist

2 SUBJECT SPECIALISTS

£20 /hr

Robert S.

Degree: Engineering Mathematics (Bachelors) - Bristol University

Subjects offered: Computing, Maths

Computing
Maths

“About Me: I’m a fresher studying Engineering Mathematics at Bristol University. When I was younger, I was neither particularly interested or any good at maths. It was not until GCSE’s that my teacher motivated and inspired me to achie...”

MyTutor guarantee

£22 /hr

Cesar Manuel F.

Degree: BSc Computer Science (Bachelors) - University College London University

Subjects offered: Computing, Physics+ 2 more

Computing
Physics
Maths
History

“Hello! My name is Cesar, I am originally from Perú but I currently study BSc Computer Science at University College London. I graduated Markham College with Distinction after completing my International Baccalaureate (IB) course, in w...”

Cookies:

We use cookies to improve our service. By continuing to use this website, we'll assume that you're OK with this. Dismiss

mtw:mercury1:status:ok