procedure writetree (ijlevelinteger)var kinteger(*uses global writer *begin if then writetree(ir[ij]- level+ )for : to level do texts write(wtabendtexts writestring(wkey[ [ij]])texts writeln( )writetree( [ij]jlevel+ end end writetreeprocedure find (var stexts scanner)var ijninteger(*uses global writer *begin texts scan( ) [ :short( ) : texts scan( )(*inputakeyb*while class texts int do inc( ) [ :short( )texts scan( )copy( skey[ ])texts scan( ) [ :short( )texts scan(send(*compute from and *for : to do [ii: [ ]for : + to do [ij: [ij- [jb[jend endtexts writestring( "total weight ")texts writeint(ww[ ] )texts writeln( )texts writestring( "path length of balanced tree ")texts writeint(wbaltree( ) )texts writeln( )writetree( )texts writeln( )computeopttree( )texts writestring( "path length of optimal tree ")texts writeint(wp[ ] )texts writeln( )writetree( )texts writeln( )for : to do [ii: for : + to do [ij: [ij- [jend endcomputeopttree( )texts writestring( "optimal tree not considering ")texts writeln( )writetree( )texts writeln(wend findas an examplelet us consider the following input data of tree with keys albert ernst peter key albert