## Invert Binary tree

Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a…

## Given a positive integer which fits in a 32 bit signed integer, find if it can be expressed as A^P where P > 1 and A > 0. A and P both should be integers.

Problem: Given a positive integer which fits in a 32 bit signed integer, find if it can be expressed as…

## Given an even number ( greater than 2 ), return two prime numbers whose sum will be equal to given number.

Problem: Given an even number ( greater than 2 ), return two prime numbers whose sum will be equal to…

## Given a linked list, return the node where the cycle begins. If there is no cycle, return null.

Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Try solving…

## Write a function that takes an unsigned integer and returns the number of ’1′ bits it has (also known as the Hamming weight).

Problem Write a function that takes an unsigned integer and returns the number of ’1′ bits it has (also known…

## Given an array of integers, every element appears twice except for one. Find that single one.

Problem: Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm…

## The 3n + 1 problem

Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide…

## SQL

Customer segment that generates maximum profit Select MAX (Profit), Customer Segment From ‘TABLE 1’ 2. Most expensive shipping mode…