Aditya Chatterjee's Blog, page 154
September 20, 2021
Design data structure that support insert, delete and get random operations
In this article, we will understand in depth the designing of a data structure that supports "insert value", "delete value" and "get random" operations where these tasks are performed in constant time O(1).
Table of contentsProblem statement naive solutionsHash function and Hash tableHashing algorithmCollisionsNew Data Structure DesignCreating the data structureOutputProblem statement naive solutionsThis problem requires us to create our own data structure that performs "insert...
Majority Element in an array
In this article, we have discussed algorithmic techniques to find the majority element in an array. The brute force algorithm takes O(N2) time while the most efficient algorithm can do it in O(N) time.
Table of contents:
Problem statement: Majority Element in an arrayNaive techniqueSorting the arrayUsing a HashmapUsing Binary Search TreeWe have earlier discussed Boyer Moore Algorithm to find the Majority element in an array.
Summary of different approaches:
ApproachTime ComplexitySpa..."Design a Data Structure" problems
In this article, we have present some must practice "Design a Data Structure" problems. These are important problems for Coding Interviews at Google and other companies. You need to modify standard data structure to form new data structures to solve this problem efficiently.
Following are the important "Design a Data Structure" problems:
Problem 1Design a data structure that supports the following three operations:
Insert: Insert an element E into the data structureDelete: Delete a given elem...September 18, 2021
Inter-process communication (IPC) & IPC types in OS
In this article, we have explained Inter-process communication (IPC) in Operating System, why is IPC needed and various ways to achieve IPC like using shared memory, message passing, buffering, pipes and more.
Table of contents:
Processes and communicationWhy need communication among processes ?What is Inter-process communication ?IPC in Shared-Memory SystemsIPC in Message-Passing SystemsBufferingPipesSocketsSemaphoresLet us get started with Inter-process communication & it's types in...
Dense Layer in Tensorflow

In this article, we have explained Dense Layer in Tensorflow with code examples and the use of Dense Layer in Neural Networks.
Table of contents:
Introduction to Neural NetworkWhat is a Layer?Dense LayerDense Layer ExamplesAdvantages and Disadvantages of Dense LayerLet us get started with Dense Layer in Tensorflow.
Introduction to Neural NetworkArtifical Neural Network, or usually simply called Neural Networks, is a computing system inspired by how animal brains works. Neural Network "le...
September 17, 2021
Structure (struct) in C [Complete Guide]
A structure is defined as a collection of same/different data types. All data items thus grouped logically related and can be accessed using variables.
Table of contents:
Basics of Structure in CStructure Declaration2.1. Tagged Structure
2.2. Structure Variables
2.3. Type Defined StructuresStructure Initialization in CAccessing Structures in CArray of Structure in CNested Structures in C
Let us get started with Structure (struct) in C.
Basics of Structure in C"Struct" keyword is used to...
Applications of Machine Learning
In this article, we have covered common ML tasks/ applications with respect to image and textual data along with the models used and examples of its use in various domains.
ContentsThe different Machine Learning applications are:
Applications using Image AnalysisImage Correction, Sharpening, Resolution & Colour CorrectionImage ClassificationObject DetectionImage Segmentation3D ProjectionPattern RecognitionFrame PredictionImage/Video SummarizationApplications using Text AnalysisTe...September 16, 2021
Size of struct in C/ C++
In this article, we have explained how to calculate the memory size of a struct in C and C Programming Language. To find the actual size, you need to understand two concepts of padding and packing. The size is not the sum of individual elements so read on.
Table of contents:
Structure PaddingStructure PackingLet us explore the ideas with code examples and explanation.
Structure PaddingComputer stores structure using the concept of word boundary.
The size of a word boundary is machine depe...
Early Exit in ML models

In this article, we will see what are the benefits of adding early exits to the neural network models and how it increases the performance of the model and overcomes various limitations present in the model.
Table of contents:
Introduction to Problems in Neural NetworkWhat exactly are these early exits?Selecting when and where to add these Early exitsAdding an appropriate interference mechanismProperties of the Neural Networks with multiple early exits?Let us get started with this.
Introd...September 15, 2021
Applications of XOR operation
In this article, we will begin with a brief introduction of what the XOR operation is, followed by its syntax in C++ and XOR applications such as memory-optimized doubly linked lists, swapping, XOR ciphers, Comparing two values, Gray codes and Partiy check.
We will be covering the following Applications of XOR operation in depth:
Making memory efficient Doubly Linked Lists aka XOR Linked ListsSwapping using with XOREncryption with XOR: The XOR CipherComparing two numbers using XORConversion...