Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed 4DGL-uLCD-SE
Fork of morseCode_1 by
Diff: Header_file.h
- Revision:
- 5:5b86521e418c
- Parent:
- 4:62c590826ddb
- Child:
- 6:421ece74143e
diff -r 62c590826ddb -r 5b86521e418c Header_file.h
--- a/Header_file.h Sat Apr 28 16:04:28 2018 +0000
+++ b/Header_file.h Sun Apr 29 01:04:11 2018 +0000
@@ -317,4 +317,46 @@
dot();
}
else{wait(1);}//error character, or space character.
-}
\ No newline at end of file
+}
+
+
+class Tree {
+public:
+ char value;
+ Tree *dot;
+ Tree *dash;
+
+ Tree(){}
+
+ Tree createRoot();
+ void insertdot(char newValue, Tree *rootNode);
+ void insertdash(char newValue, Tree *rootNode);
+ char returnvalue(Tree *rootNode);
+ //void deleteNode(Tree *deleteNode); //Didn't see the need for a delete function since the tree is pretty static
+};
+
+//Inserting an item on the "dot" side of a node
+//Adds the value, and pointers go to NULL
+void Tree::insertdot(char newValue, Tree *rootNode){
+ rootNode->dot = new Tree;
+ rootNode->dot->value = newValue;
+ rootNode->dot->dot = NULL;
+ rootNode->dot->dash = NULL;
+ return;
+}
+
+//Inserting an item on the "dash" side of a node
+void Tree::insertdash(char newValue, Tree *rootNode){
+ rootNode->dash = new Tree;
+ rootNode->dash->value = newValue;
+ rootNode->dash->dot = NULL;
+ rootNode->dash->dash = NULL;
+ return;
+}
+
+char returnvalue(Tree *rootNode){
+ return rootNode->value;
+}
+
+
+
