Cutting the Rod Problem. Part_1: Recursion and Memoization

Given pieces of rod sizes. Find the max value we can get by cutting a rod of length n and selling the pieces.

How to compute the time and space complexity of Binary Tree Algorithms

To learn about computing time and space complexities of Array algorithms, watch the Part-1:

Find minimum cost to travel to the destination railways station

There are N stations on a railway track. You are at the first station and you want to go to the final railway station. You […]

Tricks to compute the time and space complexities. Part-2 (Binary Tree)

Learn the tips and tricks to find the time and space complexities of Binary tree algorithms:

Tricks to compute the time and space complexities. Part-1 (Array)

The following video talks about the general method to find the time and space complexities of your code, esp. during the interview. This is Part-1 […]

Bitwise Operations: Working on individual bits

Write code to perform the basic operations on individual bits of a number (rather than the entire number): setBit – Set a particular bit. resetBit […]

Find kth largest element in running stream of numbers

Given a running stream of numbers and a positive number k. Write code to print the kth largest element at any time:

Reverse only the alphabets in a string

Given a string that has alphabets and special characters. Write code that reverse only the alphabets in the string and does not change the special […]

Reverse a string

Write a simple code to reverse a string. INPUT: "HELLO WORLD" OUTPUT: "DLROW OLLEH"

Maximum consecutive integers present in an array

Given an array of integers. Find the maximum number of consecutive integers present in the array. For example, if the array is: int arr[] = […]