knoten * einlesen() { string temp; knoten *sicher; knoten *tempit; knoten *first; int rein = 0; int i=-1; do { i++; if(i==0) { cin >> temp; first = new knoten; first->knotennummer = i+1; first->zeichenkette = temp; first->vor = NULL; first->nach = NULL; first->nach2 = NULL; } sicher = first; if(i>0) { cin >> temp; tempit = new knoten; tempit->knotennummer = i+1; tempit->zeichenkette = temp; tempit->vor = NULL; while(rein == 0) { if (temp <= (sicher->zeichenkette)) { if (sicher->nach == NULL) { sicher->nach = tempit; tempit->vor = sicher; tempit->nach = NULL; tempit->nach2 = NULL; rein = 1; break; } else { sicher = sicher->nach; } } if (temp > (sicher->zeichenkette)) { if (sicher->nach2 == NULL) { sicher->nach2 = tempit; tempit->vor = sicher; tempit->nach = NULL; tempit->nach2 = NULL; rein = 1; break; } else { sicher = sicher->nach2; } } rein = 0; } } } while((temp != "ENDE") && (i != MAXANZAHL-1)); return first; }