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.
The LinkedList class in Java is a doubly-linked list implementation of the List interface. This post provides an overview of common techniques to implement a linked list in Java programming language.
This post will discuss how to traverse the given directory and list out all files present in it and all its sub-directories using BFS and DFS.
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.
This post will discuss how to find permutations of a string using iteration. The implementation should be able to handle strings with duplicate characters and don’t repeat the permutations.
Write an efficient program to convert a given number to words.
In previous post, we have introduced the heap data structure and covered heapify-up, push, heapify-down and pop operations. This article covers Java implementation of Priority Queue Data Structure (Max Heap and Min heap).
A stack is a linear data structure that follows the LIFO (Last–In, First–Out) principle. That means the objects can be inserted or removed only at one end of it, also called a top.
This article covers queue implementation in Java. A queue is a linear data structure which follows the FIFO (first-in first-out) principle. That means the object which is inserted first will be the first one out, followed by the object which was inserted next.
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.
In this post, we will see graph implementation in Java using Collections for weighted and unweighted, graph and digraph.
This post will discuss how to search for a given target value in a sorted array of integers using binary search implementation provided by the C++ standard library (STL) and Java Collection framework.