All Medium Articles
  There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained after… Read More
Asked by Varun Bhatia.  Question: Write a code for implementation of doubly linked list with use of single pointer in each node.  Solution:  C++ #include… Read More
Given a linked list of size N where each node has two links: one pointer points to the next node and the second pointer points… Read More
Given a sorted and rotated array arr[] of size N and a key, the task is to find the key in the array. Note: Find… Read More
  Given a singly linked list of characters, write a function that returns true if the given list is a palindrome, else false. Examples: Input:… Read More
Lucky numbers are a subset of integers. Rather than going into much theory, let us see the process of arriving at lucky numbers: Take the… Read More
Given an unsigned integer, reverse all bits of it and return the number with reversed bits. Input : n = 1Output : 2147483648  Explanation :… Read More
Given a string S, the task is to write a program to print all permutations of a given string.  A permutation also called an “arrangement… 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
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
Predict the output of below programs Question 1 int main() {     unsigned int i=65000;     while ( i++ != 0 );     printf("%d",i);     return 0; } Output:… 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  Question 1   c #include‹stdio.h› int main() {     struct site     {         char name[] = "GeeksforGeeks";         int no_of_pages = 200;     };… Read More
In the below code, change/add only one character and print ‘*’ exactly 20 times.  int main() { int i, n = 20; for (i =… Read More
Here is an implementation. #include<stdio.h> #define my_sizeof(type) (char *)(&type+1)-(char*)(&type) int main() {     double x;     printf("%ld", my_sizeof(x));     getchar();     return 0; } Type is like a local… Read More
Given a positive integer, write a function to find if it is a power of two or not.Examples :   Input : n = 4 Output… Read More
Parity: Parity of a number refers to whether it contains an odd or even number of 1-bits. The number has “odd parity” if it contains… Read More
The very first solution that comes to our mind is the one that we learned in school. If the sum of digits in a number… Read More
Write a function that, for a given no n, finds a number p which is greater than or equal to n and is the smallest… Read More