90 likes | 163 Views
2005 Fall – TA Slide for Program HW #3. Distribute Mathematics. 3 rd Assignment (Min Heap, Max Heap). 2005.11.18 (Fri.) Choi Jung-Eun. Notice. Submit file: source ( 학번 _hw#.c), makefile Execution file name: hw3 If your program doesn’t work, please comment it on your source code Q&A
E N D
2005 Fall – TA Slide for Program HW #3 Distribute Mathematics 3rd Assignment (Min Heap, Max Heap) 2005.11.18 (Fri.) Choi Jung-Eun
Notice • Submit file: source (학번_hw#.c), makefile • Execution file name: hw3 • If your program doesn’t work, please comment it on your source code • Q&A • Web Site http://www.cs.hongik.ac.kr/~rts/class/undergraduate/2005_Fall/index.html • E-mail jechoi@cs.hongik.ac.kr Real-time systems Lab.
Submit • submit <TA account> <Directory> • Example • TA account: rtsta • Directory: class/assignment (a/hw3) >submit rtsta a/hw3 • Due date: 12/02(Fri.) 20:00 (system clock) Real-time systems Lab.
Assignment #3 – requirement • Program : Min Heap, Max Heap • You can use only 1-dimention array (size: 100) • Implementation of 5 instructions • Input: from keyboard • Output: to monitor Real-time systems Lab.
Assignment #3 – usage • Add item • usage: “add <item>” • example: add 3 • Delete Max-value or Delete Min-value • usage: “del” • example: del • Show • usage: “show” • Find item • usage: “find <item>” • example: find 5 • Quit program • usage: “quit” Real-time systems Lab.
Assignment #3 – exception handling • In case that instruction is not satisfied with given usage • In case that the item within the heap is added by add instruction Real-time systems Lab.
Assignment #3 – example (1/2) >add 5<Enter> >add 20<Enter> >add 8<Enter> >add 9<Enter> >add 6<Enter> >adee 60<Enter> Error: Incorrect operation! >add 10<Enter> >add 9<Enter> Error: Can’t add item! >show<Enter> Min Heap 5 6 8 20 9 10 Max Heap 20 9 10 5 6 8 >find 9<Enter> Min Heap : 5 Max Heap : 2 Real-time systems Lab.
Assignment #3 – example (2/2) >del<Enter> Min Value in Min Heap : 5 Max Value in Max Heap : 20 >show<Enter> Min Heap 6 9 8 20 10 Max Heap 10 9 8 5 6 >find 5<Enter> Min Heap : Not exist! Max Heap : 4 >quit<Enter> Real-time systems Lab.
Due date • Assignment #2 • submit due date: 11/14 20:00 • Assignment #3 • submit due date: 12/02 20:00 • Assignment Grade Real-time systems Lab.