What is the BigO of this program?
C++
#include
int main() {
char data[] = {'a','b','c','d','e','f','g','h'};
for(int i = 0; i < sizeof(data); i++) {
if(data[i] == 'e') {
printf("e is found");
break;
}
}
}What is the BigO of this program?
#include
int main() {
char data[] = {'a','b','c','d','e','f','g','h'};
for(int i = 0; i < sizeof(data); i++) {
if(data[i] == 'e') {
printf("e is found");
break;
}
}
}Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Jan 21, 2022, 3:17 PM EST