## Solved: The Problem With Using fgets() After scanf()

Introduction The scanf() function is a widely used function in C/C++. Although the syntax to use it is simple, it is important to understand some areas where its usage would require careful handling. One such area is when fgets() is ...

## Prime Factorisation Method Using Sieve O(log n) For Multiple Queries

Introduction Prime Factorisation Method is the method used to represent any number as the product of all prime factors of a given number. Prime numbers mean numbers with only two factors, one and the number itself.  For example, numbers such ...

## What Is Subarray With Given Sum?

Introduction A frequently asked question by Amazon, Paytm, and many other Product based companies is Subarray with given sum, “Given an unsorted array of integers, and an integer k. The task is to find whether there exists a subarray(positive length) ...

## Time And Space Complexity In Algorithms

Introduction  Countless times, we have heard our Maths teachers specify different methods for solving a particular problem. The goal is to use short and easy techniques instead of lengthy, complicated ones.  Likewise, while writing code, it is a good practice ...

## What Is A Two Pointer Technique?

Introduction “The most effective techniques are those that are simple and well-executed,” in Data Structures and Algorithms, the two pointer technique is one of them. Two Pointers is a pattern in which two pointers iterate across the data structure until ...

## Prims Algorithm- Minimum Spanning Tree (MST)

Introduction Graph algorithms are always quite intimidating to start with but are pretty easy to comprehend if you get the hang of it. We will discuss here one such beautiful algorithm to find the Minimum Spanning tree of a given ...

## Program To Reverse A Number

Introduction Reversing a number implies that the value of the unit of a given number will become the nth digit value of the number if it is n digits long, and the tens digit number will become (n-1)th place value ...

## Best Ways To Learn Data Structures And Algorithms

Introduction You may overhear people saying, “It’s important to master Data Structures and Algorithms.” But have you ever thought about why you should have a good command of Data Structures and Algorithms? Data Structures and Algorithms help us solve real-world ...

## Top Standard Algorithms for a Coding Interview

Introduction  A coding interview is a rigorous test of your data structures and algorithms abilities. Numerous programmers and mathematicians have made our lives easier by creating algorithms that can be used directly for approaching and optimizing a particular problem. In ...

## How To Convert Array To String In Any Programming Languages?

Introduction A  string is a contiguous sequence of characters in computer programming, either as a literal constant or variable. Additionally, strings must be stored sequentially because it is a contiguous sequence of characters; And the best data structure for this ...