# Category: Uncategorized

## Find the first repeating character in a given string

Objective: Given a string, write an algorithm to find the first repeating character in it. Example: String input = “horizon tutorials” Output: ‘o’ String input = “algorithms” Output: No repeating character found. Approach: Naive...

## Dynamic Programming – Maximum Subarray Problem

Objective:  The maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array of numbers which has the largest sum. Example: int [] A = {−2, 1, −3, 4, −1, 2, 1, −5,...

## Binary Tree-Inorder Traversal – Non Recursive Approach

Objective: Given a binary tree, write a non recursive or iterative algorithm for Inorder traversal. Example: Earlier we have seen “What is Inorder traversal and recursive algorithm for it“, In this article we will...

## Dynamic Programming – Longest Common Subsequence

Objective: Given two string sequences, write an algorithm to find the length of longest subsequence present in both of them. These kind of dynamic programming questions are very famous in the interviews like Amazon,...

## Level Order Traversal in Zig Zag pattern OR Print in Spiral Pattern

Objective: Given a binary Tree, Do Level Order Traversal in Zig Zag pattern OR Print in Spiral Input: A Binary Tree Output: Order Traversal in Zig Zag pattern OR Print in Spiral.

## Find a pair of numbers from an array whose sum equals k

Objective: Write an algorithm to find out whether in a given array there exists or not two numbers whose sum is exactly equals to a given number. This problem has been asked in Amazon...