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 solutions

This problem requires us to create our own data structure that performs "insert...

 •  0 comments  •  flag
Share on Twitter
Published on September 20, 2021 08:44

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 Tree

We have earlier discussed Boyer Moore Algorithm to find the Majority element in an array.

Summary of different approaches:

ApproachTime ComplexitySpa...
 •  0 comments  •  flag
Share on Twitter
Published on September 20, 2021 05:32

"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 1

Design a data structure that supports the following three operations:

Insert: Insert an element E into the data structureDelete: Delete a given elem...
 •  0 comments  •  flag
Share on Twitter
Published on September 20, 2021 04:35

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 SystemsBufferingPipesSocketsSemaphores

Let us get started with Inter-process communication & it's types in...

 •  0 comments  •  flag
Share on Twitter
Published on September 18, 2021 10:05

Dense Layer in Tensorflow

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 Layer

Let us get started with Dense Layer in Tensorflow.

Introduction to Neural Network

Artifical Neural Network, or usually simply called Neural Networks, is a computing system inspired by how animal brains works. Neural Network "le...

 •  0 comments  •  flag
Share on Twitter
Published on September 18, 2021 09:51

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 Declaration
2.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...

 •  0 comments  •  flag
Share on Twitter
Published on September 17, 2021 07:04

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.

Contents

The 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...
 •  0 comments  •  flag
Share on Twitter
Published on September 17, 2021 00:17

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 Packing

Let us explore the ideas with code examples and explanation.

Structure Padding

Computer stores structure using the concept of word boundary.
The size of a word boundary is machine depe...

 •  0 comments  •  flag
Share on Twitter
Published on September 16, 2021 09:48

Early Exit in ML models

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...
 •  0 comments  •  flag
Share on Twitter
Published on September 16, 2021 00:05

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...
 •  0 comments  •  flag
Share on Twitter
Published on September 15, 2021 22:02