Answer:
#include <iostream>
#include <array>
using namespace std;
bool isPalindrome(string str)
{
int length = str.length();
for (int i = 0; i < length / 2; i++)
if (toupper(str[i]) != toupper(str[length - 1 - i]))
return false;
return true;
}
int main()
{
array<string, 6> tests = { "madam", "abba", "22", "67876", "444244", "trymEuemYRT" };
for (auto test : tests) {
cout << test << " is " << (isPalindrome(test) ? "" : "NOT ") << "a palindrome.\n";
}
}
Explanation:
The toupper() addition forces characters to uppercase, thereby making the comparison case insensitive.
Answer:
e means we don't know so I can't tell the answer
Answer:
3) A Single linked list is a sequence of elements in which every element has link to its next element in the sequence.
DATA LINK
DATA stores actual value , LINK stores address of next node
As per information given in question, letters at the even addresses are items in linked list and the odd addresses will be used as links.
Even Address Odd Address
12 (Stores 't') 13 (Used as link)
14 (Stores 'm') 15 (Used as link)
16 (Stores 'a') 17 (Used as link)
18 (Stores 'r') 19 (Used as link)
20 (Stores 's') 21 (Used as link)
Numbers represented by circle are addresses of respective nodes. Here Front or Head has address 16. Which represents the Head Node.
Following image represents the word "smart" with respective nodes and their addressing.
Numbers represented by circle are addresses of respective nodes.
The head pointer is: 20
Answer:
Instant messaging is the type of electronic community that allows real-time discussion among members.
Answer:
Explanation:
dont open or sign up to anything that seems to good to be true