Leetcode: 463. Island Perimeter

    You are given a map in the form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by...

    Enum.ordinal() Method in Java

    Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero). For example, let's have weekdays in an enum starting from Monday,...

    Find the Occurrences Of Each Character In a String

    Find the Occurrences Of Each Character In a String without using collection. Here we are going to create simple array to store the character occurrence. If we look at ASCII value of each character...

    Longest palindrome Sub-sequence from the given String using Dynamic Programming

    Write a program to find the longest sub-sequence palindrome from the given string by using dynamic programming. For example Input String : ABCDQRDC Longest sub-sequence palindrome: 5  So let's see how we will solve and...

    How to create a graph using Java

    Let's see simple graph creation using core java and printing all the vertex along with list of edges which goes from that particular Vertex. public class MyGraph { public static void main(String[] args) {...

    Add two numbers represented by linked lists using recursive

    Add two numbers represented by linked lists using recursive method and generate the 3td linked with addition of 1st and 2nd linked list. For example: p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}...

    Reverse words in a given String using recursion

    Reverse words in a given String using recursion. We need to reverse words by words in a given line and not the character in a given string. We need to solve this by using...

    Rotate matrix by clockwise

    Given a NxN matrix and need to rotate by clockwise as given below Examples: Let's see simple java code to rotate given NxN matrix. public class MatrixRotate { private int prev, curr; public static...

    Page 1 of 17123»