All Medium Articles
News API is a simple JSON-based REST API for searching and retrieving news articles from all over the web. Using this, one can fetch the… Read More
Prerequisite – Basics of CSMA/ CD, Collision Detection in CSMA/CD  Back-off algorithm is a collision resolution mechanism which is used in random access MAC protocols… Read More
Given an array arr[], find the lexicographically largest array that can be obtained by performing at-most k consecutive swaps.  Examples :  Input : arr[] =… Read More
Python oct() function takes an integer and returns the octal representation in a string format. In this article, we will see how we can convert… Read More
Given a number n, generate a list of n composite numbers.Examples:   Input : 5 Output : 122, 123, 124, 125 Input : 10 Output :… Read More
We have discussed some of the SED command options in Sed Command in Linux/Unix with examples SED is used for finding, filtering, text substitution, replacement and… Read More
Given an array of non-negative numbers and a non-negative number k, find the number of subarrays having sum less than k. We may assume that… Read More
Given a string S. Count number of substrings in which each character occurs at most k times. Assume that the string consists of only lowercase… Read More
The following program main() { inc(); inc(); inc(); } inc() { static int x; printf("%d", ++x); } (A) prints 012 (B) prints 123 (C) prints… Read More
Consider the following program fragment if(a > b) if(b > c) s1; else s2; s2 will be executed if (A) a c (C) b >=… Read More
Given a number K and a string S, We have to Find the lexicographically smallest string str of length K such that it’s set of… Read More
Given an array A of N integers. You have to answer two types of queries : 1. Update [l, r] – for every i in… Read More
Given an array of N integers, count number of even-odd subarrays. An even – odd subarray is a subarray that contains the same number of… Read More
Introduction : Prerequisite – Execution, Stages and Throughput Registers Involved In Each Instruction Cycle:   Memory address registers(MAR) : It is connected to the address lines of… Read More
There are many situations where we use integer values as index in array to see presence or absence, we can use bit manipulations to optimize… Read More
Deadlock occurs when each transaction T in a schedule of two or more transactions waiting for some item locked by some other transaction T‘ in… Read More
In the previous article on closures in javascript, we learned that Closure is one of the most important yet most misunderstood concepts in Javascript. The… Read More
Given a decimal number n. Find the gray code of this number in decimal form. Examples:  Input : 7 Output : 4 Explanation: 7 is represented as… Read More
Given an adjacency matrix representation of an undirected graph. Find if there is any Eulerian Path in the graph. If there is no path print… Read More
In Java, we can append a string in an existing file using FileWriter which has an option to open a file in append mode. Java… Read More