# Category Archives: Data Structures

Given a circular array of size n, find the maximum subarray sum of the non-empty subarray. Examples:  Input: arr[] = {8, -8, 9, -9, 10,… Read More
Two of the nodes of a Binary Search Tree (BST) are swapped. Fix (or correct) the BST.  Input: x = 20, y = 8    … Read More
Given a binary tree, print boundary nodes of the binary tree Anti-Clockwise starting from the root.  The boundary includes  left boundary (nodes on left excluding… Read More
Given a number, find the next smallest palindrome larger than this number. For example, if the input number is “2 3 5 4 5”, the… Read More
Given an array of N elements, where each element is at most K away from its target position, devise an algorithm that sorts in O(N… Read More
Given a Binary Tree, write a function to check whether the given Binary Tree is Complete Binary Tree or not.A complete binary tree is a… Read More
Given an array of integers, find anyone combination of four elements in the array whose sum is equal to a given value X. For example, … Read More
Given an array of integers, find all combination of four elements in the array whose sum is equal to a given value X. For example, if… Read More
Given an array of integers, replace every element with the next greatest element (greatest element on the right side) in the array. Since there is… Read More