/** * Beispiel aus * * - Algorithmen und Datenstrukturen für Dummies * - von Andreas Gogol-Döring und Thomas Letschert * - Verlag Wiley-VCH; Oktober 2019 * - Kapitel 3, Daten und ihre Struktur * * @author A. Gogol-Döring, Th. Letschert */ import Foundation struct AuD_03_01_LexicalFirst { static func LexicalFirst(M: [String]) -> String { if (M.isEmpty) { return "" } else { return M.min() ?? "" } } static func run () { let words = ["a", "b", "c", "die", "Katze", "lief", "im", "Schnee"] let first = LexicalFirst(M: words) print(first) } }