Aditya Chatterjee's Blog, page 166

June 20, 2021

Median in stream of running integers [Explained]

Given that integers are being read from a data stream, we need to find the median of all the elements read so far starting from the first integer till the last integer. This is called the Median in Running stream of Integers.

Table of Contents:

How do we define median?Approach using Insertion SortApproach using Heap data structureApproach using Ordered Multiset Data StructureConclusionHow do we define median?

Median can be defined as the element in the data set which separates the higher...

 •  0 comments  •  flag
Share on Twitter
Published on June 20, 2021 22:54

June 18, 2021

Data Partitioning in System Design [Explained]

Data partitioning in simple terms is a method of distributing data across multiple tables, systems or sites to improve query processing performance and make the data more manageable. Data can be partitioned in many different ways and depending on the type of data it is partitioned in different methods.

Table of contents

The problem / Why Data Partitioning is needed?Types of Data partitioning
2.1. Horizontal Partitioning
2.2. Vertical ParitioningPartitioning Techniques
3.1. Hash Based partitio...
 •  0 comments  •  flag
Share on Twitter
Published on June 18, 2021 14:46

Least frequent element in an array

Least frequent element in an array

Given an array of N elements, our task is to find the least frequent element present in it. There are many ways to do this. In this article, we are going to talk about 3 of those methods along with their implementation.

Table of Contents

Different ways to find the least frequent element in an arrayNaive AlgorithmOptimized algorithm with array sortingOptimized algorithm with mappingDifferent ways to find the least frequent element

We are going to be exploring three methods through which we ...

 •  0 comments  •  flag
Share on Twitter
Published on June 18, 2021 13:01

June 17, 2021

What Java Programmers Should Learn In
2021?

Insanely growing demand for programmers comes with more and more competition in the field, and that ends up in "survival of the fittest". Even if you're a talented Java programmer already, there is always room for improvement. You need to keep extending your skills through effective online resources to learn Java Programming.

8 Features Of Java To Learn In 2021

Here are some ideas for what to learn to stay up to date in programming with Java:

Jenkins

Jenkins, an open-source automation server for...

 •  0 comments  •  flag
Share on Twitter
Published on June 17, 2021 03:08

June 12, 2021

Abstraction in C++ [Explained]

In this article, we have explained Abstraction in C++ in depth with different types of abstraction and code examples.
Table of contents:

AbstractionData abstraction with real life ExampleAdvantages of AbstractionTypes of AbstractionExample code of abstraction in C++Implementation TechniqueAbstraction

Abstraction means hiding the background details or functioning and displaying only important information. We have explained abstraction in C++ in depth.

Data Abstraction

Data abstraction mea...

 •  0 comments  •  flag
Share on Twitter
Published on June 12, 2021 08:22

Xiaolin Wu's Line Drawing Algorithm

Xiaolin Wu's Line Drawing Algorithm

Xiaolin Wu's Line Drawing Algorithm is a recognized Line Drawing Algorithm in Computer Graphics which is used to produce Anti-aliased lines. In this article, we have explored this in depth.

Table of contents:

What is Xiaolin Wu's Line Drawing Algorithm?What are Line Drawing Algorithms in Computer Graphics?What are Anti-aliased Lines?Working of the Xiaolin Wu's Line Drawing AlgorithmImplementation in PythonCode walk-through / Pseudo-codeApplications and Advantages of Xiaolin Wu's Line Draw...
 •  0 comments  •  flag
Share on Twitter
Published on June 12, 2021 07:55

June 11, 2021

Make String Stable [using Stack]

Given a string with opening and closing braces, our problem is to find the minimum number of operations to make the string stable. This can be solved efficiently using Stack. A string is stable based on the following rules:

An empty string is stable.If S is stable, then {S} is also stable.If S and T are both stable, then the concatenation of S and T is stable (that is ST).All of these strings are stable: {}, {}{}, and {{}{}}These strings are not stable: }{, {{}{, nor {}{.

Two operations ar...

 •  0 comments  •  flag
Share on Twitter
Published on June 11, 2021 00:02

June 10, 2021

qsort: Sorting using stdlib.h in C [Explained with examples]

In this article, we have explained how to use qsort that is Sorting using stdlib.h in C. We have presented the use-case using code examples.

Pre-requisites

Functions in C, Arrays in C, Structures in C, Pointers in C, Function-pointers in C

stdlib is a C standard header file. So a typical C library provider would provide binaries of all the function definitions that the C standard specifies. One such function usage is discussed in this article. stdlib header comes with a function named qsort for,...

 •  0 comments  •  flag
Share on Twitter
Published on June 10, 2021 22:57

Applications of Topological Sort [Explained]

Topological Sort of a directed graph is a linear ordering of its vertices such that for every directed edge u->v, vertex u comes before v in the ordering. In the Topological sort, a process can start when it has 0 prerequisites. In this article, we have covered various Applications of Topological Sort in depth.

topological-1

In this image, the graph has no vertex with zero prerequisites. For more details, go through this article: Topological sort.

Applications

The Applications of Topological Sort are:

Findi...
 •  0 comments  •  flag
Share on Twitter
Published on June 10, 2021 07:15

Functions in Python [Explained with examples]

Functions in Python [Explained with examples]

In this article, we have explored everything about functions in Python along with different types of functions that are available with Python code examples.

Table of contents:

Introduction to FunctionTypes of Functions in PythonAnonymous Functions & Built-in FunctionsHow to define User-Defined Function?Function OverloadingIntroduction to Function

Functions basically means a piece/block of code that can be used again and again whenever the coder requires, it can be imported in any other pr...

 •  0 comments  •  flag
Share on Twitter
Published on June 10, 2021 06:04