Aditya Chatterjee's Blog, page 44

March 27, 2023

5 Techniques to convert an array to vector in C++

In this article, we will learn about different ways to convert an array to vector in C++.

An Array is the collection of elements of the same data type and are stored in contiguous memory location. We can not change it's size once we have initialised it.

A Vector is also a collection of elements of the same data type but they are dynamic array i.e. we can change it's size as and when required.

There are different ways to convert array to vector in C++. Some of them are mentioned below:

Using a l...
 •  0 comments  •  flag
Share on Twitter
Published on March 27, 2023 04:55

March 25, 2023

Javascript:void(0) and # in href in HTML links

Both javascript:void(0) and # are commonly used in the href attribute of HTML links, but they have different meanings and purposes. In this article, we have explored both in depth with code examples.

Table of contents:

Javascript:void(0) and # in href in HTML linksCode Examples of Javascript:void(0) and #Advanced use-cases of Javascript:void(0) and #Javascript:void(0) and # in href in HTML links

javascript:void(0) is used to indicate that the link does not have a destination URL and that it...

 •  0 comments  •  flag
Share on Twitter
Published on March 25, 2023 17:22

Delete elements in a priority queue in C++ STL [4 methods]

In this article, we have presented different ways to delete elements in a priority queue in C++ STL. There are 4 different methods such as pop, clear and much more.

Table of contents:

Introduction to priority queuesMethod one (pop())Method two (remove specific element)Method three (erase)Method four (clear)Introduction to priority queues

A priority queue is a container in C++ STL (Standard Template Library) that allows users to store elements with different priorities. The priority queue ...

 •  0 comments  •  flag
Share on Twitter
Published on March 25, 2023 17:09

9 Advantages and 10 disadvantages of Naive Bayes Algorithm

One of the most popular classification algorithm that is used in machine learning and data mining is Naive Bayes Algorithm. It is based on Bayes theorem which states that-probability of an event can be calculated given that an another particular event has occurred by using conditional probabilities. Naive Bayes is such a supervised algorithm that can be used to solve classification problem for test set using training set.

In this article, we'll talk about some of the key advantages and disadvant...

 •  0 comments  •  flag
Share on Twitter
Published on March 25, 2023 17:06

March 24, 2023

Blockchain: A Revolutionary Technology - Benefits, Challenges, Future

Blockchain: A Revolutionary Technology - Benefits, Challenges, Future

Blockchain is a ground-breaking technology that has skyrocketed in popularity recently. It functions as a decentralized, digital ledger that keeps track of transactions and archives them in a transparent, safe manner. Although the majority of people only know blockchain as it relates to cryptocurrencies like Bitcoin, the technology has wide-ranging uses in fields including finance, healthcare, supply chain management, and voting systems. In this essay, we'll examine the possibilities of blockcha...

 •  0 comments  •  flag
Share on Twitter
Published on March 24, 2023 13:26

March 23, 2023

struct vs union vs enum in C

In this article, we will have a look at what actually is Structure, Union and Enumeration in C and will have look at differences between them.

Table of contents :

Introduction and needStructure in CUnion in CEnumerations in CDifferences between them (table included)Introduction:

Every rookie C programmer when comes to know the concept of array, is fascinated by the working principle of it. But as soon as they get to know that an array in C cannot store non-primitive data type by default, ...

 •  0 comments  •  flag
Share on Twitter
Published on March 23, 2023 17:05

Inheritance in Java: Basics, Advantages and Best Practices

Inheritance in Java: Basics, Advantages and Best Practices

One of the core ideas of object-oriented programming (OOP), inheritance enables a new class to be built upon an existing class. In Java, inheritance is accomplished via extending a class, which allows the new class to take on the parent class's methods and properties. In this post at OpenGenus, we'll examine the fundamentals of Java inheritance and look at its benefits for OOP.

Learn more about OOP in Java.

Syntax and Types of Inheritance

In Java, the syntax for inheriting a class is as follows:...

 •  0 comments  •  flag
Share on Twitter
Published on March 23, 2023 12:52

Polarity and Subjectivity in NLP

Polarity and subjectivity are two important concepts in natural language processing (NLP) that help machines understand the sentiment and emotions conveyed in human language. In this article, we'll explore these two concepts in depth and how they are used in NLP.

Table Of ContentPolaritySubjectivityImportance of Polarity and Subjectivity in NLPMath Logic and Formula Behind Polarity and SubjectivityCode ImplementationPros and ConsApplications of Polarity and Subjectivity AnalysisPolarit...
 •  0 comments  •  flag
Share on Twitter
Published on March 23, 2023 00:13

Exploring Architecture of CPU

Architecture-of-CPU

Exploring the Architecture of the Core CPU Concept provides an in-depth look at the design and functionality of the core CPU concept. This article delves into the technical aspects of the architecture, including key terminology and diagrams, to help readers develop a thorough understanding of how the core CPU operates. Through detailed explanations of the concept's complexity, performance considerations, and real-life applications, readers will gain practical insights into CPU architecture. The...

 •  0 comments  •  flag
Share on Twitter
Published on March 23, 2023 00:09

Schedule Events in Calendar Problem [Segment Tree]

In this article, we will discuss the My Calendar 1 problem where we need to schedule events in a calendar such that there is no conflict. This will involve the concept of Segment Tree.

Pre-requisites

Line sweep algorithmSegment treeProblem statement

Here you will be given a couple of start and end time of some events. You have to return true if the event is executable and false if its not.

An event is executable if its start and end time does not overlap with other events intervals, though a...

 •  0 comments  •  flag
Share on Twitter
Published on March 23, 2023 00:01