## Determine if singly linked list is a palindrome.

Problem statement:  Given a singly linked list, determine if it a palindrome. Example: Input:  1-> 2-> 3-> 2-> 1 Output: True Description: Palindrome is a word, number or sequence of characters which reads the same backward or forward. Words like… Continue Reading

## Level Order Traversal of Binary Tree

Problem statement: Level order traversal for binary tree. Example:   Logic: Basic idea behind level order traversal is explained in previous post on same topic. However, instead of using extra TreeNode as marker node to mark end of level, we… Continue Reading

## Binary Tree Longest Consecutive Sequence

Problem statement: Given a binary tree, find the length of the longest consecutive sequence path. The path refers to any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The longest consecutive… Continue Reading

## Max Consecutive Ones

Problem statement: (Leetcode problem no:487)  Given a binary array, find the maximum number of consecutive 1s in this array if you can flip at most one 0. Example: Input:  [1,0,1,1,0] Output: 4 Description:  Flip the first 0 will get maximum… Continue Reading

## LRU Cache

In computers, cache memory provides fast access to processor by storing frequently used computer programs, data and applications; However size of cache memory is relatively small. Because of the size constraint, it is required to invalidate data from cache and store new… Continue Reading

## Bitwise Operators

Bitwise operators are used to perform operations on bits. Most of the times programmers works on byte, int, char etc. data types and does not pay attention to bit level operations. However bit operators are used to manipulate values for… Continue Reading