Print binary representation of a number – C, C++, Java, and Python
Print binary representation of a given number in C, C++, Java, and Python using built-in methods and custom routines.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedPrint binary representation of a given number in C, C++, Java, and Python using built-in methods and custom routines.
This post will discuss the XOR linked list, which is used to reduce memory requirements of doubly-linked lists using a bitwise XOR operator.
The KMP Algorithm (or Knuth, Morris, and Pratt string searching algorithm) cleverly uses the previous comparison data. It can search for a pattern in linear time as it never re-compares a text symbol that has matched a pattern symbol.
We have discussed the linked list data structure, which is dynamic in nature (the memory is allocated during the run time). Now the question that might be on a few people’s minds is – can a linked link be implemented statically as well? This post tries to answer this question.
This post will discuss various linked list implementation techniques in detail and construct a singly linked list in the C programming language.
Heapsort is an in-place, comparison-based sorting algorithm and can be thought of as an improved selection sort as it divides the input into a sorted and an unsorted region.
This article covers circular queue implementation in C. A queue is a linear data structure that serves as a collection of elements, with three main operations: Enqueue, Dequeue, and Peek.
This articles covers stack implementation in C. A stack is a linear data structure that serves as a collection of elements, with three main operations: push, pop and peek.
This post will cover graph data structure implementation in C using an adjacency list. The post will cover both weighted and unweighted implementation of directed and undirected graphs.
All algorithms can be classified into in-place and out-of-place algorithms based on the amount of extra space used by them. In this quick article, we’ll explore the difference between the two.
Write a C/C++ program without using the main() function. We are allowed to change the entry point of the program from main() to any other function or remove the main() function altogether.
Write an algorithm to get 0 and 1 with equal probability using a function that generates random numbers from 1 to 5 with equal probability.