【正文】
using selection sort.Write a function of selection sort(選擇排序).(10point)void insertion_sort(a, n)int a[ ]。int n。{ int i, j。 int t。 for(i=1。in。i++){ t=a[i]。 for(j=i1。j=0amp。amp。ta[j]。j)a[j+1]=a[j]。 a[j+1]=t。 }}(3).Suppose that a hash table contains 11 entries from 0 through 10 and that the following keys are to be mapped into the table.(32,75,63,48,94,25,36,18,70)Hash function h(k)=k mod 11(a)Determine the hash addresses and resolute collision by linear probing.0 701 2 3 254 485 366 947 188 639 7510 32(b)Determine the hash addresses and resolute collision by chaining. (10point )0 1 2 3 25364 487056 947 188 639 7510 32(4)For each of the following binary trees, determine the order in which the nodes will be visited mixed order given by invoking function A(5point)Void A(TreeNode *root, void(*Visit)(TreeEntry x) ){ If(root){ Visit(rootentry)’ B(rootleft, Visit)。 B(rootright, Visit)。 } }void B(TreeNode *root, void(*Visit)(TreeEbtry x)){ If(root){ A(rootleft, Visit)。 Visit(rootentry)。 A(rootright, Visit)。 }}五. (2)Insert a new node r taken as the right child of node s and draw a threadedtree.(a) By hand (b) By some sentences in C (10 point)(a)(b) rrightchild=srightchild。 // s的右子女指針或后繼線索傳給rrrightthread=srightthread。 //標(biāo)志一同傳送//arleftchild=s。rleftthread=1。 // r為leftchild或?yàn)閟的前驅(qū)線索//bsrightchild=r。srightthread=0。 //r成為s的右子女//c