Algorithms

Jump Search Algorithm In Java

Jump search algorithm is a pretty new algorithm to search for an element in a sorted array. The idea of…

1 year ago

Knuth Morris Pratt Pattern Search Algorithm

What is Knuth Morris Pratt or KMP algorithm ? KMP is an algorithm which is used in the applications of…

1 year ago

Binary Search Algorithm In Java

Binary Search is a Logarithmic search which finds the target element in a sorted array in O(logN) times compared to…

1 year ago

Leetcode Unique Paths Java Solution

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only…

2 years ago

Leetcode Regular Expression Matching Java Solution

Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' Matches any single…

2 years ago

Leetcode ZigZag Conversion Java Solution

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display…

2 years ago

Leetcode Sum Root to Leaf Numbers Java Solution

Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which…

2 years ago

Leetcode 59 Spiral Matrix II Java Solution

Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. Example: Input: 3 Output:…

2 years ago

Leetcode 54 Spiral Matrix Java Solution

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Input: [ [ 1,…

2 years ago

Leetcode 53 Maximum Subarray Java Solution

Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its…

2 years ago

This website uses cookies.