Skip to main content

Dynamic Programming

Fine Longest Palindrome Substring of a given String


Comments

Popular posts from this blog

Data Structures using Java

package com.test.count; /**   *     * @author Kiran   *   */ public class LinkedList { Node headNode ; /** *   This method appends the Node at the end of the List *   * @param data */ public void appendNode( int data ) { Node currentNode = headNode ; if ( currentNode == null ) { Node newNode = new Node( data ); headNode = newNode ; return ; } while ( currentNode .getNextNode()!= null ) { currentNode = currentNode .getNextNode(); } currentNode .setNextNode( new Node( data )); } /** * This method prints all the Nodes/Values of the   * LinkedList *   */ public void printNodes() { Node currentNode = headNode ; if ( currentNode == null ) { System. out .println( " The Node is Null" ); return ; } else { System. out .print( "   " + currentNode .getData()); while ( currentNo...

Gang of Four Design Patterns

Gang of Four(GOF) Design Patterns are divided in to 3 categories. Creational Design Patterns ( 5 Patterns ) AbstractFactory Builder Method Factory Method Prototype Singleton Singleton pattern is used when there is only one instance of the object need to be created per JVM instance. This pattern is used internally by the Connection Pooling to create the objects only on demand. Structural Design Patterns ( 7 Patterns ) Adapter Bridge Pattern Composite Pattern Decorator Pattern Facade FlyWeight FlyWeight Pattern is used when there are a large number of objects to be created, and they need to be created efficiently. This pattern is used by many frame works to create the objects using configuration. Proxy Behavioral Design Patterns ( 11 Patterns ) Chain Of Responsibility Pattern Command Interpreter Iterator Mediator Memento Memento is used internally by Text Editor Applications, where ctr+Z or cmd+Z operations are used to remember the snap shot of the data. State State Design Pattern is use...