聯絡人管理的時間複雜度
在你剛於前一個練習實作的聯絡人管理應用程式中,findContact 方法的時間複雜度是什麼?
public Contact findContact(String name) {
// Complete loop to search through contacts
for (Contact contact : contacts) {
if (contact.getName().equals(name)) {
// Return the match
return contact;
}
}
return null;
}
本練習屬於課程
