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
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.
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.
It is a basic algorithm for generating lines on computer screen. line is generated between given 2 endpoints
In computer science, deterministic algorithm is an algorithm which, given a particular input, always produces the same result. This is used to increase the efficiency of machines.
there is no such method using string copy
8086 assembly language program to check wether given number is perfect or not
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 (); }