Check your IELTS writing task 1 and essay, this is a free correction and evaluation service.
Check IELTS Writing it's free
British CouncilIDPCambridge
IELTS Writing Answer Sheet
Barcode 3
Candidate Name:
Heng Sokunmary
Center Number:
1
2
3
4
   
Candidate Number:
2
8
0
3
0
Module (shade one box):
Academic:
 
General Training:
Test Date:
2
D
8
D
   
0
M
8
M
   
2
Y
0
Y
2
Y
2
Y

How the insertion sort works

How the insertion sort works y09Ol
Besides explaining the particular code implementation, I would briefly describe the mechanism of insertion sort and provide an illustrated visual for the sorting process. Generally, the basic working mechanism of insertion sort is that it picks the first element to assume it is located on the sorted side, in the code implementation I pick the head pointer and assigned it to the picked node pointer. To perform comparing between node and swap, the insertion sort mechanism will need to pick the key in this list and in code implementation, this key is the currentNode. The program will perform compare the first node and the key node. For instance, I have a doubly linked list as below: Because this operation sorts ascendingly, if the pickedNode is greater than currentNode, the program swaps them: However, it’s only in terms of illustration. In real code implementation, instead of providing more if-else statements or redundancy of unnecessary code, the condition is combined in a while loop. Because after each loop, the picked Loop is set to the next node until it reaches the tail, the outside while needs to come with the condition that it will run until the picked Node is null. And because when the picked Node is not null, the current node is assigned to the next node of the picked node according to the mechanism of insertion sort. The condition in the nested while is quite abstracted; hence, I describe it via the illustrated visual below: Assuming now the picked node is the third node and the current node is after the picked node Now because the current node is not null and the previous node of it also, the program performs comparing these two. At the first glance, we can also see that 11 is less than 33; so, the condition now is met(condition: current node and the previous node are not null, the previous node data of a current node is less than the current node). It comes to the code inside the nested while, the program will call swap operation to swap these two(just swap the data of node without swapping their next and previous pointer). Because the mechanism of insertion sort is it will pick the current node and compare it with all the elements of the sorted side(the side with the last element is the picked node). To follow that in code implementation, the current node will be back to the previous node and the process will be iterated until it doesn’t meet the condition of these two while loops. To illustrate, I continue the above process: Swap data of nodes in comparing above. Continue back the current node to the previous node and compare. This process will continue until there are no previous nodes of the current node(the previous node is null now). Now looking at the position of the initial current node(after the picked node), from this to any previous element is the sorted linked list. Thereby, the currentNode will be set to the fourth node and the program continue the while loop until the linked list is absolutely sorted.
Besides
explaining the particular code implementation, I would
briefly
describe
the
mechanism
of
insertion
sort
and provide an illustrated visual for the sorting process.
Generally
, the basic working
mechanism
of
insertion
sort
is that it
picks
the
first
element
to assume it
is located
on the sorted side, in the code implementation I
pick
the head pointer and assigned it to the picked node pointer. To perform comparing between node and
swap
, the
insertion
sort
mechanism
will need to
pick
the key in this
list
and in code implementation, this key is the currentNode. The
program
will perform compare the
first
node and the key node.
For instance
, I have a
doubly
linked
list
as below:
Because
this operation
sorts
ascendingly
, if the pickedNode is greater than currentNode, the
program
swaps them:
However
, it’s
only
in terms of illustration. In real code implementation,
instead
of providing more if-else statements or redundancy of unnecessary code, the
condition
is combined
in a while
loop
.
Because
after each
loop
, the picked
Loop
is set
to the
next
node until it reaches the tail, the outside while needs to
come
with the
condition
that it will run until the picked Node is
null
. And
because
when the picked Node is not
null
, the
current
node
is assigned
to the
next
node of the picked node according to the
mechanism
of
insertion
sort. The
condition
in the nested while is quite abstracted;
hence
, I
describe
it via the illustrated visual below: Assuming
now
the picked node is the third node and the
current
node is after the picked node
Now
because
the
current
node is not
null
and the
previous
node of it
also
, the
program
performs comparing these two. At the
first
glance, we can
also
see
that 11 is less than 33;
so
, the
condition
now
is met
(condition:
current
node and the
previous
node are not
null
, the
previous
node data of a
current
node is less than the
current
node). It
comes
to the code inside the nested while, the
program
will call
swap
operation to
swap
these two(
just
swap
the data of node without swapping their
next
and
previous
pointer).
Because
the
mechanism
of
insertion
sort
is it will
pick
the
current
node and compare it with all the
elements
of the sorted side(the side with the last
element
is the picked node). To follow that in code implementation, the
current
node will be back to the
previous
node and the process will
be iterated
until it doesn’t
meet
the
condition
of these two while
loops
. To illustrate, I continue the above process: Swap data of nodes in comparing above. Continue back the
current
node to the
previous
node and compare. This process will continue until there are no
previous
nodes of the
current
node(the
previous
node is
null
now)
.
Now
looking at the position of the initial
current
node(after the picked node), from this to any
previous
element
is the sorted linked
list
. Thereby, the currentNode will
be set
to the fourth node and the
program
continue the while
loop
until the linked
list
is
absolutely
sorted.
Do not write below this line
Official use only
CC
5.5
LR
5.5
GR
6.5
TA
6.0
OVERALL BAND SCORE
6.0
Barcode 1
Barcode 1

IELTS essay How the insertion sort works

👍 High Quality Evaluation

Correction made by newly developed AI

✅ Check your Writing

Paste/write text, get result

⭐ Writing Ideas

Free for everyone

⚡ Comprehensive report

Analysis of your text

⌛ Instant feedback

Get report in less than a second

Copy promo code:ly5W7
Copy
Recent posts
  • Describe a clock that you recived
    On the occasion of my birthday A year ago, my father took me to a antique store to look for an alarm clock. The reason why my father chooses watches and especially antiques is because timing is very important and according to my father, it is the key to success, and choosing vintage watches is becau...
  • Economic progress vs other types of progresses
    Whether economic progress is the most important goal of a country or not is subject to debate. While some people believe that the most important goal of a country is economic progress, others defend that other types of progress are equally important. This essay will discuss both sides of the argumen...
  • The charts below show what UK graduate and push graduate students who did not go into full time work de after leaving college in 2008
    he charts illustrate the number of graduate and post-graduate students did after completing their course in a college excluding full-time work in the UK in the year 2008. Overall, both the graduate and post-graduate scholar had a maximum number of students attending further study, and the least num...
  • police budget and expenses
    The pie charts and table illustrate the source of the police budget in 2017 and 2018 and how the money was segregated into three different sectors of salaries, technology, and buildings and transport. Overall, the total budget assigned to the police department increased in 2018, as the government c...
  • Scrool travel by different transportations
    Many students of varying ages from as little as 5 years up to 12 who attend school everyday have different means of travel. It seems students were significantly more active in the past in 1990 in comparison to the most recent study conducted in 2010. According to statistics, there has been a huge i...
  • Local Food or Imported Food
    Thanks to globalization, today, we are able to eat almost whatever we want. People now have knowledge of different cultures' eating habits through television and the internet. Three decades ago, we did not know such things called Gouda cheese or sushi in Turkey. Even if globalization is quite benefi...
  • Fast Food With Higher Taxes
    Fast food is consumed in a widespread manner around the world lately since it is effortless and fast to prepare and eat yet it causes several health problems and sometimes results in death. For this reason, some people claim governments should intervene with this situation by taking certain measures...
  • WRITING: PEOPLE NOWADAYS ARE SHOPPING TOO MUCH. WHAT ARE THE REASONS? (WRITE A PARAGRAPH OF 150 WORDS)
    The improvement in quality of life leads to people nowadays shopping too much. Because of basic human needs are fully met, the public spends money on shopping to make an impression by buying no need that helps people show wealth and even importance to the rest of the world. Additionally, shopping c...
  • Handmade products are superior
    Handmade products are appealing because of its uniqueness and romantic look. Machine made products cannot accomplish this impression considering they are mass-produced half of the time because of that they are not perceived as engaging as handmade products. Firstly, handmade products are sustainabl...
  • The Bar leisure Activities
    The bar chart compares the amount of time each day that people from four different countries spent doing activities while on holiday in Greece in August 2019. The activities were going to the beach, visiting different attractions, and reading. Overall, the tourists spent the most time reading books...
  • TEENAGER ACTIVITIES FROM 2002 to 2007
    The bar graph illustrates the number of hours per week that teenagers spend on doing a certain set of activities during 2002 to 2007 at Chester. Overall, it can been inferred that watching television was most the preferred activity, whereas bowling steadily accounted for lower interest over the yea...
  • One health for One community
    Nowadays, four requisites for life are increasing dramatically to serve the demand. o prevent future problems, “One Health” strategy has risen up. One Health is to achieve optimal health outcomes. It promotes mainly 3 sides including emerging and re-emerging disease, Due to increasing in population...