Miscellaneous

## Find the n-th number whose binary representation is a palindrome

Find the nth number whose binary representation is a palindrome. Do not consider the leading zeros, while considering the binary representation. Consider the 1st number… Read More »

## Shuffle a pack of cards and answer the query

Given a pack of 2^N cards (0 … 2^N – 1), shuffle it in N steps. At step k (0 < k < N) we… Read More »

## std::set_symmetric_difference in C++

Symmetric difference of two sorted ranges The symmetric difference of two sets is formed by the elements that are present in one of the sets,… Read More »

## numpy.flipud() in Python

About : numpy.flipud(array) : Flip array(entries in each column) in up-down direction, shape preserved Parameters : array : [array_like]Input array, we want to flip Return… Read More »

## numpy.nanargmax() in Python

numpy.nanargmax(array, axis = None) : Returns indices of the max element of the array in a particular axis ignoring NaNs. The results cannot be trusted… Read More »

## Extract ‘k’ bits from a given position in a number.

How to extract ‘k’ bits from a given position ‘p’ in a number? Examples: Input : number = 171 k = 5 p = 2… Read More »

## Creative Programming In Processing | Set 2 (Lorenz Attractor)

Creative Programming In Processing | Set 1 (Random Walker) The Lorenz system is a system of ordinary differential equations first studied by Edward Norton Lorenz,… Read More »

## Analysis of algorithms | little o and little omega notations

The main idea of asymptotic analysis is to have a measure of efficiency of algorithms that doesn’t depend on machine specific constants, mainly because this… Read More »

## Computing INT_MAX and INT_MIN with Bitwise operations

Prerequisites : INT_MAX and INT_MIN in C/C++ and Applications. Arithmetic shift vs Logical shift Suppose you have a 32-bit system : The INT_MAX would be… Read More »

## Microsoft Interview experience | Set 118 (On-Campus for IDC)

Around 100 applied for the first round of Microsoft Internship offer. Basic Criteria was to have a CGPA of greater than 7.00. Round 1: Three… Read More »

## Oracle Interview Experience | Set 49 (On-Campus)

Round 1 : Online Test Duration: 2+ hours Format: 4 Sections each having 3-4 subsections each having some MCQs Level: Easy | (91/120~) selected Content… Read More »

## Order statistic tree using fenwick tree (BIT)

Given an array of integers with limited range (0 to 1000000). We need to implement an Order statistic tree using fenwick tree. It should support… Read More »

## Top IT Certifications

In the recent days, we often find interviewers asking us that have you done any certification. If you are having any certification in your resume,… Read More »

## Print ‘K’th least significant bit of a number

A number N is given. We need to print its ‘K’th Least Significant Bit. Examples : Input : num = 10, k = 4 Output… Read More »

## Check if two numbers are equal without using comparison operators

Following are not allowed to use 1) Comparison Operators 2) String functions Examples: Input : num1 = 1233, num2 – 1233 Output : Same Input… Read More »