

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Answer Question 1 and THREE other questions. All questions carry equal %.
Examiners: Prof. G. Hurley Dr. S. Foley Mr. D.O’Donovan
(c) If node 67 is deleted from the binary search tree followed by the subsequent deletion of node 29, draw the tree which would result in each case. Describe the changes required in the creation of each new tree. [5 %] (d) Write a function in C to search the tree for a particular value supplied as a parameter. The function’s result should indicate the success of the search. Define variables and data structures as appropriate. [10 %]
( )
1
N jj i
b i a i j approx x j x i (^) a i i
=≠
Describe, in detail, the workings of this method. [5 %] (b) Define the data types and declare variable for the above formula ( i.e. declare a , b, x and (^) N ) [2 %] (c) Write a C function, which when passed the system of equations, (i.e. a and b) will re- arrange them such that they are diagonally dominant. [7 %] (d) Write a function to implement the Gauss-Siedel method for n linear equations with n unknowns. This function should first re-arrange the equations into a diagonally dominant form. [11 %]
and use it to illustrate these attributes. [4 %] (c) The merge sort algorithm is an example of a recursive sort algorithm. Write a C program to implement the merge sort algorithm. [18 %]