TP
This commit is contained in:
parent
b456ffc7b7
commit
9401c75cbd
BIN
Cours/M313_2020_2021_CM4.pdf
Normal file
BIN
Cours/M313_2020_2021_CM4.pdf
Normal file
Binary file not shown.
BIN
Cours/M313_CM5.pdf
Normal file
BIN
Cours/M313_CM5.pdf
Normal file
Binary file not shown.
14
Enoncés/TP/AlgoPartieC.txt
Normal file
14
Enoncés/TP/AlgoPartieC.txt
Normal file
@ -0,0 +1,14 @@
|
||||
Begin
|
||||
if isEmpty(msg) // Si msg"-.."
|
||||
then return getUserObject(morse) //
|
||||
else if charAt(msg,O)=='-' then // "-"
|
||||
return decodeletterInmorse(leftChild(morse),substring(msg,1)) // ".."
|
||||
else if charAt(msg,0)=='.' then
|
||||
return decodeletterInMorse(rightChild(morse),substring(msg,1))
|
||||
else return decodeLetterInMorse(morse,substring(msg,1)) //
|
||||
|
||||
|
||||
Function decodeInmorse(ABin morse,ABin morseInUse,String msg); String
|
||||
In: alphabet morse morse dans un arbre binaire et une copie morseInuse pour pouvoir "remonter à la racine"
|
||||
Do: renvoie le message en alphabet A-2
|
||||
Begin
|
18
Enoncés/TP/AlgoPartieD.txt
Normal file
18
Enoncés/TP/AlgoPartieD.txt
Normal file
@ -0,0 +1,18 @@
|
||||
Function decodeInmorse(ABin morse,ABin morseInUse,String msg); String
|
||||
In: alphabet morse morse dans un arbre binaire et une copie morseInuse pour pouvoir "remonter à la racine"
|
||||
Do: renvoie le message en alphabet A-2
|
||||
Begin
|
||||
|
||||
if isEmpty(msg)
|
||||
then return getUserObject(morseInUse)
|
||||
else if charAt(msg,0)=='-' then
|
||||
return decodeInMorse(morse,leftchild(morseinuse),substring(msg,1))
|
||||
else if charAt(msg,0)=='.' then
|
||||
return decodeletterInMorse(rightChild(morse),substring(msg,1))
|
||||
else return decodeLetterInMorse(morse,substring(msg,1))
|
||||
else if charAt(msg,0)=='/' then
|
||||
return getUserObject(morseInUse)+decodeInmorse(morse,morse,SubString(msg,1))
|
||||
else if charAt(msg,0)==' ' then
|
||||
return getUserObject(morseInUse)+' '+ decodeInmorse(morse,morse,SubString(msg,1))
|
||||
else //optionel/
|
||||
return getUserObject(morse,morseInUse,substring(msg,1))
|
BIN
Enoncés/TP/TP5_Arbre_Seance2.pdf
Normal file
BIN
Enoncés/TP/TP5_Arbre_Seance2.pdf
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user