can u please why my 2,5,10 questions are incorrect
Quiz wrong answers
string s = “bca”;
do {
cout << s << ’ ';
} while(next_permutation(s.begin(), s.end()));
cout << s;
What is the output of the given code?
bca cab cba abc
bca cab cba cba
bca bca bca bca
bca cab cba bca
list< int > myList = { 2, 6, 12, 13, 15, 18, 20};
cout << binary_search(myList.begin(), myList.end(), 20) ;
Output is 20 and time complexity is Linear in size of the list.
Output is 1 and time complexity is Linear in size of the list.
Output is 20 and time complexity is Logarithmic in size of the list.
Output is 1 and time complexity is Logarithmic in size of the list.
@D19APPPP0016 hey,in first question next permutation function will print all the permutations of given string in lexographical order so just find permutation of string in lexographical order .
In 2 qstn binary search function return true if third argument of function is found in given list as 20 is there in list it will return true or 1 and complexity of binary search is logarithmic.
Hope you get it.
bca cab cba abc
why in the output abc is there although it is should not be as it is not lexographically greater than previous permutation.
and in second question the output is coming linear complexity
@D19APPPP0016 bro 2 qstn ka answer wrong dia hoga and first wale ka bhi wrong hoga ,apka logic sahi hai ya galat ans dekh lie honge.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.