Presentation is loading. Please wait.

Presentation is loading. Please wait.

Document that explains the chosen concept to the animator

Similar presentations


Presentation on theme: "Document that explains the chosen concept to the animator"— Presentation transcript:

1 Document that explains the chosen concept to the animator

2 Course Name: Design and Analysis of Algorithm
Insertion Sort Course Name: Design and Analysis of Algorithm Level: UG. Authors Praveen Pal

3 Learning Objectives After interacting with this Learning Object, the learner will be able to: Sort an array using insertion sort. How insertion sort works.

4 1 2 3 4 5 Definitions of the components/Keywords:
Insertion sort is an elementary sorting algorithm that sorts one element at a time. It is typically used for sequencing small list. At each iteration ,array is divided in two sub-array left sub-array(Sorted) and right sub-array (unsorted) (figure on next slide) . This sorting technique scans the sorted list for the correct insertion point for each of the items from the unsorted list. This method is called Insertion sort because the element is placed on it’s correct place the time of insertion. This sorting technique is also called the “in-place sorting” because it does not require extra space for sorting . 2 3 4 5 4

5 Insertion Sort 7 2 4 6 1 3 2 7 4 6 1 3 input array
Note :- at each iteration, the array is divided in two sub-arrays: left sub-array right sub-array sorted unsorted

6 Master layout or diagram
INSTRUCTIONS SLIDE 1 Master layout or diagram Make a schematic diagram of the concept Explain to the animator about the beginning and ending of the process. Draw image big enough for explaining. In above image, identify and label different components of the process/phenomenon. (These are like characters in a fi lm)‏ Illustrate the basic flow of action by using arrows. Use BOLD lines in the diagram, (minimum 2pts.)‏ In the slide after that, provide the definitions of ALL the labels used in the diagram 2 3 4 5

7 IMPORTANT NOTE TO THE ANIMATOR:
All the instructions/labels or anything WRITTEN in blue are CONTENT NOT TO BE DISPLAYED! All the instructions WRITTEN in black are CONTENT TO BE DISPLAYED! This is not applicable for images as there can be overlapping of these colours there. This should be followed for all the instructions, labels,etc… Kindly keep a note of this while displaying text in the animation.

8 INSTRUCTIONS SLIDE Components 1 Index 2 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 10 3 Array or list 4 Note: 1:All digit written in white letter in the sender are “element” or “value at index n “(n refers to index number ex. value at index 4 = 5). . 5

9 Project OSCAR IDD Template 4.7
Master Layout Insertion Sort Status:- All steps will display here Put the Start, Pause, Stop, Step, reset ,Think button to control animation. Put a slidebar to control the speed of animation. 1 2 3 4 5 6 7 8 9 16 28 9 2 5 7 6 4 1 3 Current Index: When “Think” is pressed, the applet will run with a time delay so that user can think about the next step. When “Step” button is pressed, the applet will start, but will stop after every step until the step button is pressed. Note : Animators are free to change the color and graphics to make animation more effective. Project OSCAR IDD Template 4.7

10 1 Explain the process 2 In this step, use an example to explain the concept. It can be an analogy, a scenario, or an action which explains this concept/process/topic Try to use examples from day-to-day life to make it more clear You have to describe what steps the animator should take to make your concept come alive as a series of moving images. Keep the examples simple to understand, and also to illustrate/animate. 3 4 5

11 Stepwise description of process
1 The goal of the document is to provide instructions to an animator who is not a expert. You have to describe what steps the animator should take to make your concept come alive as a moving visualization. Use one slide per step. This will ensure clarity of the explanation. Add a image of the step in the box, and the details in the table below the box. You can use any images for reference, but mention about it's copyright status The animator will have to re-draw / re-create the drawings Add more slides as per the requirement of the animation 2 3 4 5

12 3 Step 1: 1 2 4 5 Compare and insert 1 2 3 4 5 6 7 18 16 12 11 32 11
1 2 3 4 5 6 7 2 18 16 12 11 32 11 14 21 3 4 Instruction for the animator Text to be displayed in the working area (DT) Show the array with it’s index and values. Represent selected index by gray color. Show the comparison and swap visually. Display instruction on the Top of animation screen. Follow these instruction for all slides. Array to be sorted in ascending order select first index. 5

13 3 Step 1: 1 2 4 5 Compare and insert 1 2 3 4 5 6 7 18 16 12 11 32 14
1 2 3 4 5 6 7 2 18 16 12 11 32 14 21 3 4 Instruction for the animator Text to be displayed in the working area (DT) Represent selected index by gray color. Sorted value by red color. . Insert 16. Compare 16 & 18 , 18 > 16, exchange , Increment index by one ie. index =2 5

14 3 Step 1: 1 2 4 5 Compare and insert 1 2 3 4 5 6 7 16 18 12 11 32 14
1 2 3 4 5 6 7 2 16 18 12 11 32 14 21 3 4 Instruction for the animator Text to be displayed in the working area (DT) Represent selected index by gray color. Sorted value by red color. Show the proper movement of element from one place to another. Insert 12. Compare 12 & 18 , 18 > 12, exchange , Compare 12 & 16 , 16 >12 exchange. Increment index by one ie. index = 3 5

15 3 Step 1: 1 2 4 5 Compare and insert 1 2 3 4 5 6 7 12 16 18 11 32 14
1 2 3 4 5 6 7 2 12 16 18 11 32 14 21 3 4 Instruction for the animator Text to be displayed in the working area (DT) Represent selected index by gray color. Sorted value by red color. Insert 12. Compare 12 & 18 , 18 > 12, exchange , Compare 12 & 16 , 16 >12 exchange. Increment index by one ie. index = 3 5

16 3 Step 1: 1 2 4 5 Compare and insert 1 2 3 4 5 6 7 12 16 18 11 32 14
1 2 3 4 5 6 7 2 12 16 18 11 32 14 21 3 4 Instruction for the animator Text to be displayed in the working area (DT) Represent selected index by gray color. Sorted value by red color. Insert 11. Compare 11 & 18 , 18 > 11, exchange , Compare 11 & 16 , 16 >11 exchange. Compare 11 & 12,12 > 11 exchange. Increment index by one ie. index = 4 5

17 3 Step 1: 1 2 4 5 Compare and insert 1 2 3 4 5 6 7 11 12 16 18 32 14
1 2 3 4 5 6 7 2 11 12 16 18 32 14 21 3 4 Instruction for the animator Text to be displayed in the working area (DT) Represent selected index by gray color. Sorted value by red color. Insert 32. Compare 32 & 18 , 18 < 32, No exchange , no need to further comparison., 32 is on it’s correct place Increment index by one ie. index = 5 5

18 3 Step 1: 1 2 4 5 Compare and insert 1 2 3 4 5 6 7 11 12 16 18 32 14
1 2 3 4 5 6 7 2 11 12 16 18 32 14 21 3 4 Instruction for the animator Text to be displayed in the working area (DT) Represent selected index by gray color. Sorted value by red color. Insert 11. Compare 32 & 11 , 11 < 32 , exchange, Compare 18 & 11 , 11 < 18 , exchange, Compare 16 & 11 , 11 < 16 , exchange, Compare 12 & 11 , 11 < 12 , exchange, Compare 11 & 11 , 11 = 11 , No exchange , no need to further comparison., Increment index by one ie. index = 6 5

19 3 Step 1: 1 2 4 5 Compare and insert 1 2 3 4 5 6 7 11 12 16 18 32 14
1 2 3 4 5 6 7 2 11 12 16 18 32 14 21 3 4 Instruction for the animator Text to be displayed in the working area (DT) Represent selected index by gray color. Sorted value by red color. . Insert 14. Compare 32 & 14 , 14 < 32 , exchange, Compare 18 & 14 , 14 < 18 , exchange, Compare 16 & 14 , 14 < 16 , exchange, Compare 12 & 14 , 14 > 12 , No exchange , no need to further comparison., Increment index by one ie. index = 7 5

20 3 Step 1: 1 2 4 5 Compare and insert 1 2 3 4 5 6 7 11 12 14 16 18 32
1 2 3 4 5 6 7 2 11 12 14 16 18 32 21 3 4 Instruction for the animator Text to be displayed in the working area (DT) Represent selected index by gray color. Sorted value by red color. Insert 21. Compare 32 & 21 , 21 < 32 , exchange, Compare 18 & 21 , 21 > 18 , , No exchange , no need to further comparison., 5

21 3 Step 1: 1 2 4 5 Compare and insert 1 2 3 4 5 6 7 11 12 14 16 18 21
1 2 3 4 5 6 7 2 11 12 14 16 18 21 32 3 4 Instruction for the animator Text to be displayed in the working area (DT) Represent selected index by gray color. Sorted value by red color. Insertion sort complete. 5

22 Interactivity and Boundary limits
1 Interactivity and Boundary limits In this section, you will add the ‘Interactivity’ options to the animation. Use the template in the next slide to give the details. Insert the image of the step/s (explained earlier in the Section 3) in the box, and provide the details in the table below. The details of Interactivity could be: Types: Drop down, Slider bar, Data inputs etc. Options: Select one, Multiple selections etc Boundary Limits: Values of the parameters, which won’t show results after a particular point Results: Explain the effect of the interaction in this column Add more slides if necessary 2 3 4 5

23 Test your understanding
Electrical Engineering Slide 4 Slide 4 Slide Slide 40 Introduction Definitions Analogy Test your understanding (questionnaire)‏ Lets Sum up (summary)‏ Want to know more… (Further Reading)‏ Interactivity: Array Size : Values : : Try it yourself Place an input box to enter the size of array not more than 15. Place an another input box to enter values to be sorted of size specified in above input box. . In the input box the user will input all the numerical values that he/she wants to sort. After entering the selected values, master layout1 procedure is to be done Display array of size entered above as input , with it’s index and values . Allow values to be entered one by one. 23 Credits

24 3 1 2 4 5 Let me try (allow user to select and sort) 1 2 3 4 5 6 8 7 9
1 2 3 4 5 6 2 8 7 9 37 84 2 82 3 4 Instruction for the animator Text to be displayed in the working area (DT) If user click on “let me try” button then display this array and allow user to do all the tasks by own. Give four chances to user to select correct answer after that correct the answer and move the user to next step. If user click four or more time right answer then give a greeting to user “very good you are going right” 5

25 3 1 2 4 5 Let me try (allow user to select and sort) 1 2 3 4 5 6 8 7 9
1 2 3 4 5 6 2 8 7 9 37 84 2 82 3 4 Instruction for the animator Text to be displayed in the working area (DT) Follow the same process as described in slide 12 – 21 to sort an array. To swap value user click on both value which he/she want to swap. Color the element red which has reaches to it’s correct position. 5

26 Self- Assessment Questionnaire for Learners
INSTRUCTIONS SLIDE Self- Assessment Questionnaire for Learners Please provide a set of questions that a user can answer based on the LO. They can be of the following types: These questions should be 5 in number and can be of objective type (like MCQ, Match the columns, Yes or No, Sequencing, Odd One Out). The questions can also be open-ended. The user would be asked to think about the question. The author is requested to provide hints if possible, but a full answer is not necessary. One can include questions, for which the user will need to interact with the LO (with certain parameters) in order to answer it.

27 Questionnaire for users to test their understanding
INSTRUCTIONS SLIDE Questionnaire for users to test their understanding Please make sure that the questions can be answered by interacting with the LO. It is better to avoid questions based purely on recall.

28 Project OSCAR IDD Template 4.7
Question 1: What operation does the Insertion Sort use to move numbers from the unsorted section to the sorted section of the list? Answers: 1. Swap 2. Divide & conquer 3. move 4. no one Correct answer: Swap Feedback/Justification to be displayed: If user clicks correct answer then display ____ Correct ____ If user clicks incorrect answer then display ____Incorrect Swap is right answer go to the animation again_______. Project OSCAR IDD Template 4.7

29 Project OSCAR IDD Template 4.7
Question 2: A partially sorted array is given below red line represent the sort marker then find How many comparison and swap are needed to sort the next element. 5 6 1 2 3 4 11 13 14 18 19 15 12 Answers: 3 comparison 2 swap. comparison 2 swap. Element Is at right place. 3 comparison 3 swap. Correct answer: 3 comparison 2 swap Feedback/Justification to be displayed: If user clicks correct answer then display ____ Correct ____ If user clicks incorrect answer then display ____Incorrect ,1 is right answer, go to the animation again_______. Project OSCAR IDD Template 4.7

30 Question 3:- Insertion sort is fast for?
Answers: For large size list. For small size list . works fine for both large and small size list. no one Correct answer: For small size list. Feedback/Justification to be displayed: If user clicks correct answer then display ____ Correct ____ If user clicks incorrect answer then display ____Incorrect 2 is right answer go to the animation again_______. Project OSCAR IDD Template 4.7

31 Project OSCAR IDD Template 4.7
Question 4: How many comparison and exchanges are occur in best case of insertion sort if N is the number of element in the list. Answers: N-1 comparison 0 exchanges. N comparison 0 exchanges. N comparison N exchanges. N-1 comparison N-1 exchanges. Correct answer: N-1 comparison 0 exchanges. Feedback/Justification to be displayed: If user clicks correct answer then display ____ Correct ____ If user clicks incorrect answer then display ____Incorrect 1 is correct answer go to the animation again_______. Project OSCAR IDD Template 4.7

32 Project OSCAR IDD Template 4.7
Question 5: What is true? Answers: Insertion sort is an in-place sorting. Insertion sort is an elementary sort algorithm. Running time of insertion sort depends on input. 1 and 2. All are true. Correct answer: 4 Feedback/Justification to be displayed: If user clicks correct answer then display _____Correct ________ If user clicks incorrect answer then display ______Incorrect 4 is correct answer watch the animation again____. Project OSCAR IDD Template 4.7

33 Project OSCAR IDD Template 4.7
References Website links for further reading: Books: “Introduction to Algorithm” Thomas H. Coremen Project OSCAR IDD Template 4.7


Download ppt "Document that explains the chosen concept to the animator"

Similar presentations


Ads by Google