Java biometric-determine if the base has a continuous sequence of repeats

Source: Internet
Author: User

Repetition of four successive bases


It is not possible to determine if multiple bases are duplicated.

public class testconsecutivebases{  public static void main  (String[]  args)  {    java.util.scanner input = new java.util.scanner ( system.in);         system.out.print ("enter the number  of values:  ");     string dnaseq = input.nextline ();         if  (Isconsecutivefour (DNASEQ))        System.out.println ("the series has consecutive four bases");     Else    system.out.println ("The series has no consecutive four  bases ");   }  public static boolean isconsecutivefour (String T)  { char[] dt = t.tochararray ();       for  ( int i = 0; i < dt.length - 3; i++)  {      boolean  isEqual = true;               for  (int j = i; j < i + 3; j++)  {         if  (dt[j] !=  (dt[j + 1))  {           isEqual = false;           break;        }       }           if  (isequal)  return  true;    }        return false;  }}


Java biometric-determine if the base has a continuous sequence of repeats

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.