Answer:
String word = "George slew the dragon";
int pos = word.indexOf("dr");
String drWord = word.substring(pos, pos+4);
System.out.println(drWord);
Explanation:
Assuming dr is always there, we don't have to check the validity of 'pos'. Normally, you would!
Answer:
one sec
what is that called?
if you have more than one try
then you should just take an "EDUCATIONAL GUESS"
it's a 50/50 chance
just take it
Explanation:
<h2><u><em>
YOU GOT THIS MAN! :3</em></u></h2>
Answer:
abacus is first calculating device
Answer:
well it game
Explanation:
its gamw because you have to be smart with word njbhjvkgv
Answer:
(a) What is the best case time complexity of the algorithm (assuming n > 1)?
Answer: O(1)
(b) What is the worst case time complexity of the algorithm?
Answer: O(n^4)
Explanation:
(a) In the best case, the if condition will be true, the program will only run once and return so complexity of the algorithm is O(1)
.
(b) In the worst case, the program will run n^4 times so complexity of the algorithm is O(n^4).