Let L = length of the string.
greatest integer (L/2) gives the number of pairs of characters that must be compared.
For example if there are 10 letters 10/2 = 5.
abcdeedcba
If there are 11 letters, 11/5= 5.5, also 5. The 6th letter won't matter in this palindrome because it doesn't have to match another character.
abcdefedcba
Once we have the number of pairs [L/2], we need only run a loop,
as 'i' goes from 1 to [L/2]
check that "character i" = "character L+1-i"
a write the algorithm to concatenate two given string
Return an iterator to the string if it exists, or the container's end iterator if it does not.
there is no such method using string copy
Algorithm Step1: Read A, B, C Step2: If A > B is True, then check whether A > C, if yes then A is greatest otherwise C is greatest Step3: If A > B is False, then check whether B > C, if yes then B is greatest otherwise C is greatest Give the Flowchart Answer
/*To check whether a string is palindrome*/includeincludevoid main () { int i,j,f=0; char a[10]; clrscr (); gets(a); for (i=0;a[i]!='\0';i++) { } i--; for (j=0;a[j]!='\0';j++,i--) { if (a[i]!=a[j]) f=1; } if (f==0) printf("string is palindrome"); else printf("string is not palindrome"); getch (); }
a write the algorithm to concatenate two given string
civic
The halting problem reduction can be used to determine if a given algorithm is computable by showing that it is impossible to create a general algorithm that can predict whether any algorithm will halt or run forever. This means that there are some algorithms for which it is impossible to determine their computability.
Undecidable languages are languages for which there is no algorithm that can determine whether a given input string is in the language or not. Examples of undecidable languages include the Halting Problem and the Post Correspondence Problem. Decidable languages, on the other hand, are languages for which there exists an algorithm that can determine whether a given input string is in the language or not. Examples of decidable languages include regular languages and context-free languages. The key difference between undecidable and decidable languages is that decidable languages have algorithms that can always provide a definite answer, while undecidable languages do not have such algorithms.
A language is decidable if there exists an algorithm that can determine whether any given input belongs to the language or not. To demonstrate that a language is decidable, one must show that there is a Turing machine or a computer program that can correctly decide whether any input string is in the language or not, within a finite amount of time.
Complexity of an algorithm is a measure of how long an algorithm would take to complete given
Return an iterator to the string if it exists, or the container's end iterator if it does not.
No, the halting problem is undecidable, meaning there is no algorithm that can determine whether a given program will halt or run forever.
Yes, the halting problem is undecidable, meaning that there is no algorithm that can determine whether a given program will halt or run indefinitely.
To prove that a language is decidable, one must show that there exists a Turing machine that can determine whether a given input string belongs to the language in a finite amount of time. This can be done by providing a clear algorithm or procedure that the Turing machine follows to make this determination.
Type your answer here... i think we should first enter 1 number then check it
This is the definition of an algorithm - a list of orders of how to solve a given programming problem.