Given an array of positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be… Read More »

#
All Medium Articles

A binary search tree (BST) is a node based binary tree data structure which has the following properties. My Personal Notes arrow_drop_up Save

Predict the output of below C programs. My Personal Notes arrow_drop_up Save

Following questions have asked in GATE CS exam. My Personal Notes arrow_drop_up Save

Write a function rotate(ar[], d, n) that rotates arr[] of size n by d elements. My Personal Notes arrow_drop_up Save

On some rare machines where branching is expensive, the below obvious approach to find minimum can be slow as it uses branching. My Personal Notes… Read More »

Asked by SG My Personal Notes arrow_drop_up Save

There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained after merging… Read More »

Asked by Varun Bhatia. My Personal Notes arrow_drop_up Save

You are given a Double Link List with one pointer of each node pointing to the next node just like in a single link list.… Read More »

An element in a sorted array can be found in O(log n) time via binary search. But suppose we rotate an ascending order sorted array… Read More »

Given a singly linked list of characters, write a function that returns true if the given list is palindrome, else false. Recommended: Please solve it… Read More »

Lucky numbers are subset of integers. Rather than going into much theory, let us see the process of arriving at lucky numbers, My Personal Notes… Read More »

Given an unsigned integer, reverse all bits of it and return the number with reversed bits. Input : n = 1 Output : 2147483648 On… Read More »

A permutation, also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with… Read More »

Most of us have studied Computer Networks in a very abstract manner. In other words, not many of us know how the abstract concepts of… Read More »

Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12,… Read More »

Predict the output of below programs My Personal Notes arrow_drop_up Save

In the below code, change/add only one character and print ‘*’ exactly 20 times. My Personal Notes arrow_drop_up Save

Here is an implementation. My Personal Notes arrow_drop_up Save