mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-09 20:20:56 +08:00
Update CountNumBinaryStrings
This commit is contained in:
@ -1,3 +1,31 @@
|
|||||||
|
package DynamicProgramming;
|
||||||
|
/*
|
||||||
|
* here is a important algo in this we have to count
|
||||||
|
* maximum no. of different binary strings which doesnot have
|
||||||
|
* consectuive 1s
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test Case:
|
||||||
|
|
||||||
|
int n=30;
|
||||||
|
|
||||||
|
startAlgo();
|
||||||
|
System.out.println(numStrIS(n));
|
||||||
|
System.out.println(endAlgo()+"ms");
|
||||||
|
|
||||||
|
startAlgo();
|
||||||
|
CountNumBinaryStr out=new CountNumBinaryStr();
|
||||||
|
System.out.println(out.numStrR(n).ans);
|
||||||
|
System.out.println(endAlgo()+"ms");
|
||||||
|
|
||||||
|
startAlgo();
|
||||||
|
System.out.println(countStrings(n,0));
|
||||||
|
System.out.println(endAlgo()+"ms");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
public class CountNumBinaryStr {
|
public class CountNumBinaryStr {
|
||||||
public static long startTime;
|
public static long startTime;
|
||||||
public static long endTime;
|
public static long endTime;
|
||||||
|
Reference in New Issue
Block a user