 
Summary: University of Wuppertal
Faculty C  Department of Mathematics
Dr. Holger Arndt, Dipl.Math. Sigrid Fischer
Algorithms and Data Structures
WS 2004/2005
Exercise Sheet 4
Exercise 11 (4 p.) Sketch the Btree for B = 4 after each of the following operations
. create an empty tree
. insert data records with the keys 60, 59, · · · , 50 one after the other
. delete the data record with the key 50
. insert data records with the keys 70 and 71
. delete the data record with the key 58
. delete the data record with the key 52
Exercise 12 (4 p.)
a) Implement the following procedure for indirect sorting by selection in C or
C++ :
void selection sort indirect (data record a[], int pi[], int n)
/* Determine a permutation pi[0..n1] of the numbers 0..n1,
so that the data records are sorted by ascending keys:
a[pi[0]].key <= a[pi[1]].key<= ... <= a[pi[n1]].key */
