advertisement
var adpushup = window.adpushup || {};
adpushup.que = adpushup.que || [];
adpushup.que.push(function () {
if (adpushup.config.platform === "MOBILE") {
adpushup.triggerAd("21eae76a-c83f-42b0-aec5-01d590a53f37");
} else if ((window.outerWidth <= 768) || (window.outerWidth == 0)) {
adpushup.triggerAd("21eae76a-c83f-42b0-aec5-01d590a53f37");
}
});
#include<stdio.h>
int get_len(char *s)
{
int len = 0;
while(s[len] != '\0')
len++;
return len;
}
int main()
{
char *s = "lengthofstring";
int len = get_len(s);
printf("%d",len);
return 0;
}
a) O(1)
b) O(n)
c) O(n2)
d) O(logn)
What is the time complexity of the following code used to find the length of the string?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What is the time complexity of the following code used to find the length of the string?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!