Aditya Chatterjee's Blog, page 51

February 23, 2023

4 ways to remove elements from Multiset in C++ STL

Multiset is a container in C++ STL (Standard Template Library) that stores elements in a specific order as per their value. It is similar to a set but allows duplicates. Multiset is implemented as a balanced binary search tree. Removing elements from a multiset is an important operation in many algorithms and applications. In this article, we will explore different ways to remove elements from a multiset in C++ STL including:

Using the multiset::erase() functionUsing the multiset::erase() func...
 •  0 comments  •  flag
Share on Twitter
Published on February 23, 2023 00:48

February 22, 2023

Sliding Window Technique [Explained]

In this article, we will discuss about the sliding window technique and how it is useful while solving problems.

Table of Contents:

Introduction to Sliding WindowIdea of sliding windowExamples of sliding windowHow to identify sliding Window QuestionsQuestions set for sliding window patternIntroduction to Sliding Window

The sliding window pattern is a common technique used to solve problems involving arrays or strings.As its name suggest, it takes subset of data from given arrays or string...

 •  0 comments  •  flag
Share on Twitter
Published on February 22, 2023 11:39

Generating IP Addresses [Backtracking String problem]

In this article, we will explore a common problem of restoring IP addresses from a given string of digits. For example, given the string "25525511135", the valid IP addresses that can be generated are "255.255.11.135" and "255.255.111.35". With step-by-step guide and helpful tips, you will be able to efficiently and accurately restore all possible IP addresses from the given string without any hassle.

Table of Contents̥BacktrackingApproachCodeAnalysisBacktracking

To solve this problem we ...

 •  0 comments  •  flag
Share on Twitter
Published on February 22, 2023 11:37

Calculator console application in Python

We build a console calculator application using Python Programming Language in this article.

This application can perform basic arithmetic operations like addition, subtraction, multiplication and division.It can evaluate simple mathematical expressions like 8 + 9 - 6 ** 7 (** stands for power operation)The application can store the resultant value after a calculation. The user can use this value in further calculations by using the letter 'p' in its place.
if the last calculated value was 5,...
 •  0 comments  •  flag
Share on Twitter
Published on February 22, 2023 11:35

Calculator with JavaScript

In this article, I will explain the steps on how I created a calculator with JavaScript with User Interface using HTML and CSS.

Table of contents:

Features/Requirements

Screenshot

HTML code

Styles with CSS

JavaScript:

Generate the buttonsON/OFF functionalitySet the numbersThe calculate functionalityThe main logicGet the final resultClear All/Clear Last functionality1. Features/Requirements:

create a UI for the calculator

have ON/OFF functionality

perform basic calcul...

 •  0 comments  •  flag
Share on Twitter
Published on February 22, 2023 11:30

Delete an element in HTML DOM [3 ways]

HTML DOM (Document Object Model) is the structure of HTML elements that defines the way a web page is displayed on a browser. HTML DOM consists of various elements, such as headings, paragraphs, tables, and images, among others.When creating a website, it's common to use HTML elements to structure and style the content on a page. However, sometimes, it may be necessary to delete or remove an element from HTML DOM. Deleting an element from HTML DOM can be accomplished in a variety of ways, depend...

 •  0 comments  •  flag
Share on Twitter
Published on February 22, 2023 06:50

February 21, 2023

Multi-thread Java program to find all prime numbers < N

In this article, we will develop a multithreaded java program to find all prime numbers below than N. We will use Sieve of Eratosthenes algorithm to find prime numbers and it will be run in parallel.

Introduction
Prime numbers are an important and fundamental concept in mathematics, and finding all prime numbers less than a given limit is a common problem in computer science.The Sieve of Eratosthenes algorithm is a popular and efficient way to solve this problem, but it is inherently sequenti...
 •  0 comments  •  flag
Share on Twitter
Published on February 21, 2023 11:42

Resilient Backpropagation (Rprop): The Robust Optimization Algorithm for Training Deep Neural Networks

Introduction

Resilient Backpropagation (Rprop) is a popular optimization algorithm used in training artificial neural networks. The algorithm was first introduced by Martin Riedmiller and Heinrich Braun in 1993 and has since been widely adopted due to its effectiveness in training deep neural networks.

In this article, we will discuss the basics of Rprop, how it works, and its advantages over other optimization algorithms.

The Basics of Backpropagation

Before diving into the specifics of Rprop, ...

 •  0 comments  •  flag
Share on Twitter
Published on February 21, 2023 11:32

Different ways to delete file in C

Different ways to delete file in C

Different ways to delete file in C

The C programming language, with its versatility and powerful memory manipulation capabilities, is well-suited for system programming tasks such as file management, including file deletion. The topic "Different ways to delete file in C" explores the efficient and flexible approaches to deleting files using the C programming language. Since C is widely used for developing portable applications, the different file deletion methods can be applied to various operating systems and platforms.

This ar...

 •  0 comments  •  flag
Share on Twitter
Published on February 21, 2023 08:17

February 19, 2023

Server Sent Events (SSE)

Server Sent Events (SSE)

In this article, we will cover one of the important backend communication design pattern which is Server Sent Events (SSE).


Table of contents:Introduction to Sever Sent EventsWhy do we need server sent events?ImplementationExplanationConclusionIntroduction to Server Sent Events

Lets first see what happens when you enter the domain name of website or serch something on the web

The DNS server resolves the domain name into the corresponding IP( Internet Protocol) address

Now when the...

 •  0 comments  •  flag
Share on Twitter
Published on February 19, 2023 13:05