c++ - What is the correct Big O of this code -
i'm trying learn big o notation , i'm little confused c++ code: void enterelements(int *s1, int s1size) { for(int x = 0;x < s1size;++x) { retry: cout<<"element "<<x + 1<<": "; cin>>s1[x]; int valid = validation(); if(valid == 1) { cout<<"the input must numbers."<<endl; goto retry; } } } because don't know how got 3 results: 9n + 1 -> o(n) 7nm + 2m + 2n + 1 -> o(nm) 7n^2 + 4n + 1 -> o(n^2) is of correct? if not, can me find correct answer? int validation() { int validation = 0; if(cin.fail()) { validation = 1; cin.clear(); cin.ignore(std::numeric_limits<std::streamsize>::max(),'\n'); } else validation = 0; return validation; } big-oh notation isn't applicable here. have lower bound, there absolutely no gurantees on validation(), big-oh designation o(in...