代写COS5021-B Data Structures and Algorithms调试Haskell程序

Module Title: Data Structures and Algorithms

Module Code: COS5021-B

Module Credit: 20

Level: L5

Academic Year: 2024/25

Date due: Check on the Canvas.

Length limit: There is no limit whereas each question should be explained for each steps performed.

Learning Outcomes:

This assessment will evaluate follow learning outcomes of the module:

LO1: Recognise common data structures and fundamental algorithms and be familiar with the associated terminology.

LO2: Define Abstract Data Types in terms of their data structures.

Assessment Methods:

Resit- Coursework - This consists of six (06) questions including their sub-parts. You need to answer all the questions according to the question asked. Note: Understanding the questions is part of the assessment and no AI tools would be used for this assessment.

Please take note of the following regulations/advice where appropriate:

• Check the assignment marking criteria when doing your assessment.

• Go through your lecture/lab materials on the canvas for more understanding.

Guidelines:

Each student is given a (different) list of numbers to be used, in sequence, as keys for entries into a heap, into a hash table and into an AVL tree.

Your assignment is to show the trace of the operations of insertion, re-structuring, etc.

involved for your list of keys when they are entered into a heap, a hash table and an AVL tree.

Form. of Submission

Your submission should be.

 in a plain text file

 uploaded in Canvas module assessment section.

 The content of your submitted file should be as follows.

1. Have your UoB in the first line, e.g.

DSA Coursework 16012345

2. The word 'data' and your assigned list of keys, e.g.

keys 25, 10, 15, ...

Find your keys against your name and UB number in Data file.

I recommend that you copy and paste the whole line on to your submission document. When you paste the line, it will be quite noticeable if it shows someone else's UB number. You can then safely delete your UB number from the copy, knowing you have the right data.

1. Binary Heap

The task here is to show a trace of the operations needed to insert objects with your (list of) keys, one by one, into an initially empty miniHeap with restoration of heap order (if necessary) with each insertion.

Your submission should have the section heading 'Heap trace' followed by the coded trace of operations:

 Hx to create a hole at location x in the heap;

 X to move the hole up the heap by swapping the hole with its parent;

 Ixx to insert key xx into the hole;

with the coded operations in sequence on successive lines, e.g.

Heap trace

H1

I25

H2

X

I10

H3

I15

...

2. Heap Build

For this part, your keys are loaded into the heap without application of heap order. Show a trace of the operations in the heapBuild process, to apply heap order to the (loaded) heap.

Your submission should have the section heading 'Heap Build trace' followed by the coded trace of operations:

 Xxx to swap the object having key xx with its parent;

with the coded operations in sequence on successive lines, e.g.

Heap Build trace

X15

...

3. Heap Sort

This part is for heap maintenance during the output phase of heap sort, i.e. you begin with the heap resulting from the previous section (2. Heap Build). Show a trace of the operations to output each object (from the root) and then to restore heap order after each output.

Your submission should have the section heading 'Heap Sort trace' followed by the coded trace of operations:

 Mxx to remove the object with key xx from the root (and so create a hole at the root);

 L to move the hole down the heap by swapping the hole with its left child;

 R to move the hole down the heap by swapping the hole with its right child;

 Xxx to move object having key xx into the hole (and delete the node that previously contained key xx);

with the coded operations in sequence on successive lines, e.g.

Heap trace

M10

L

L

X57

M12

R

X39

M15

L

L

X84

...

4. AVL Tree

The task here is to show a trace of the operations needed to insert objects with your (list of) keys, one by one, into an initially empty AVL tree with restoration of AVL balance (if necessary) after each insertion.

Your submission should have the section heading 'AVL trace' followed by the coded trace of operations:

 Ixx to insert key xx at the root of the previously empty AVL tree;

 IxxLyy to insert key xx as the left child of the node containing key yy;

 IxxRyy to insert key xx as the right child of the node containing key yy;

 Rxx to rotate the node containing key xx with that of its parent (in order to restore AVL balance);

with the coded operations in sequence on successive lines, e.g.

AVL trace

I25

I10L25

I15R10

R15

R15

...

5. Hash Table (1)

The task here is to show a trace of the operations needed to insert objects with your (list of)

keys, one by one, into an initially empty 11-bucket hash table with

0 1 2 3 4 5 6 7 8 9 10

11 12 13 14 15 16 17 18 19 20 21

22 23 24 25 26 27 28 29 30 31 32

33 34 35 36 37 38 39 40 41 42 43

44 45 46 47 48 49 50 51 52 53 54

55 56 57 58 59 60 61 62 63 64 65

66 67 68 69 70 71 72 73 74 75 76

77 78 79 80 81 82 83 84 85 86 87

88 89 90 91 92 93 94 95 96 97 98

99

1 2 3 1 2 3 1 2 3

10 11 12 13 14 15 16 17

18 19 20 21 22 23 24 25 26

27 28 29 30 31 32 33 34 35

36 37 38 39 40 41 42 43 44

45 46 47 48 49 50 51 52 53

54 55 56 57 58 59 60 61 62

63 64 65 66 67 68 69 70 71

72 73 74 75 76 77 78 79 80

81 82 83 84 85 86 87 88 89

90 91 92 93 94 95 96 97 98

99

 (primary) hash function h1(x) = x mod 11 (see table at the end of this page)

 and using linear probing for collision resolution.

Your submission should have the section heading 'Hash Table trace 1' followed by the coded trace of operations:

 Pn to probe bucket n (to see if it already contains an entry);

 Ixx@n to insert key xx into bucket n;

with the coded operations in sequence on successive lines, e.g.

Hash Table trace

P3

I25@3

P10

I10@10

P3

P4

I14@4

...

6. Hash Table (2)

The task here is the same as for the previous section (5. Hash Table (1)) except that collision resolution is to use the secondary hash function h2(x) = (x mod 3) + 1 (see table at the end of this page).

Your submission should have the section heading 'Hash Table trace 2' followed by the coded trace of operations (same coding as for previous section).

Hash Functions

The body of each table contains key values. The value of the hash function for a key is shown (in bold) at the head of the column in which the key appears.

primary hash function secondary hash function

Coursework Marking Criteria

Since every student gets a different data set, it is not possible to give a sample solution to the coursework. There is a single marking criterion: correctness of the solution. However partial credit will be awarded to solutions based on what mistakes are made. It is very important that for each step of the questions in the entire coursework should be backup with its explanation.

For instance, if you insert/delete a key in the tree, you should clearly explain why you have inserted/deleted the key in the respected location. May be due to a current key is less than or greater than the previous key etc. Keep in your mind a mistake at the early stage could end with wrong tree or answers and you will be deducted the marks. Double-check your current step while proceeding with the further steps.

The components of the coursework are weighted as follows:

 Binary Heap: 20%

 Heap Build: 15%

 Heap Sort: 15%

 AVL Tree: 20%

 Hash Table (1): 15%

 Hash Table (2): 15%



热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图