Palindromic Tree | Introduction & Implementation

We encounter various problems like Maximum length palindrome in a string, number of palindromic substrings and many more interesting problems on palindromic substrings . Mostly of these palindromic substring problems have some DP O(n2) solution (n is length of the given string) or then we have a complex algorithm like Manacher’s algorithm which solves the… Read More »

Command line arguments in C/C++

The most important function of C/C++ is main() function. It is mostly defined with a return type of int and without parameters : int main() { /* … */ } We can also give command-line arguments in C and C++. Command-line arguments are given after the name of the program in command-line shell of Operating… Read More »

Java.net.HttpURLConnection Class in Java

HttpURLConnection class is an abstract class directly extending from URLConnection class. It includes all the functionality of its parent class with additional HTTP specific features. HttpsURLConnection is another class which is used for the more secured HTTPS protocol. Where is it used? It is one of the popular choices among the Java developers for interacting… Read More »

Lexicographically first palindromic string

Rearrange the characters of the given string to form a lexicographically first palindromic string. If no such string exists display message “no palindromic string”. Examples: Input : malayalam Output : aalmymlaa Input : apple Output : no palindromic string Simple Approach: 1. Sort the string characters in alphabetical(ascending) order. 2. One be one find lexicographically… Read More »