Least Palindromes


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Least Palindromes

  1. #1
    Join Date
    Jan 2006
    Posts
    10

    Unhappy Least Palindromes

    If I put in Raceca, it displays:

    Enter a string ===>> Raceca
    String:Raceca
    Palindrome: false
    Almost Palindrome: false
    Least Palindrome:RacecacecaR

    It's supposed to go :
    Enter a string ===>> Raceca
    String:Raceca
    Palindrome: false
    Almost Palindrome: false
    Least Palindrome:RacecaR

    I need to use the least amount of letters
    Code:
      private String leastPal()
     {
    	String temp="";
      if(isPal(s1)==true)
      {
        return s1;
      }
      else
      {
      	String e="";
      	String f="";
      	int j=s1.length();
    	for(int k=0; k<j; k++)
    		e=s1.substring(0,k);
    	int h=e.length();
    	for(int m=h-1;m>=0; m--)
    	{
    		f+=s1.charAt(m);
     	 temp=s1+f;
    	if(isPal(temp))
        {
    	
      
           return temp;
           
        }
     
    }}
     return temp;
     
    }
    How could I change it so that it stops at the first letter, checks, and then goes throught the loop again? Thanks for your help

  2. #2
    Join Date
    Jan 2006
    Location
    india
    Posts
    1

    Unhappy any mca project tiltle

    Hi

    I am Beena.I am looking for a project topic for my mca main project.I pefer to do it in c# ( any web related project).

    Actually it is a group project(three members including me).So the project should be big enough to divide it as three modules.Plz tell the project topic and a brief summary of that project,b'coz we want to discuss it with our guide in technopark,then only they will give permission to do the project.Plz mail me the topic and its's summary.

    Plz help me it's very urgent.Hope for a good result.

    By
    Beena

Similar Threads

  1. Palindromes
    By franklin brown in forum Java
    Replies: 3
    Last Post: 02-07-2001, 07:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center