Found 33676 Articles for Programming

Python – Alternate rear iteration

Pranavnath
Updated on 25-Aug-2023 13:53:33

304 Views

Introduction Implementing alternate rear iteration using Python involves basic usage of list data structure and functionality with the help of looping structures. This problem applies simple mathematical skills that allow us to determine even numbers to print the alternate number from the back side. The data structures available in the Python language are lists, tuples, and dictionaries. It provides the users with the facility of iterating through the different types of data structures. Most commonly, the for loop is used to iterate through the lists or tuples. Alternate rear iteration In this article, the iteration is followed from the back ... Read More

How to Find the average of two list using Python?

Pranavnath
Updated on 25-Aug-2023 13:39:03

807 Views

Introduction Python is popular worldwide because of its simplicity and flexibility with other applications. In the 21st century, handling data is the most challenging task for organizations with a high volume of data, and with the development of data science and machine learning it has become easier to access. The List is a data structure consisting of changeable elements after the initialization. The lists are usually assigned a value within a brackets “[]” in some ordered form. To Find the average of two lists using Python In this article, we will explore various techniques for finding the average of ... Read More

Finding the Cartesian product of strings using Python

Pranavnath
Updated on 25-Aug-2023 13:36:14

400 Views

In this article, the user will learn how to find the cartesian product of a string using Python. String manipulation is possible using Python language. The wide varieties of inbuilt functions and operators are available in Python to perform certain operations on the string. The Python language is an eminent one and is primarily used in developing the applications for the specific need of the user. In this article, various methods used to find the Cartesian product of the given strings is found. The Cartesian product is used in Python language to get all possible combinations of the given string. ... Read More

Finding All Occurrences of a substring in a Python string

Pranavnath
Updated on 25-Aug-2023 13:34:30

5K+ Views

The strings are composed of characters and initialized in the code using simple or double quotes and substring is also a character present inside a string. Python is a versatile and high-level language that can be understood easily by the user. In this article, all the occurrences of the substring are found in a string using Python language can be done with various methods. Some common methods are index() method, in the operator, find() method, and use a regular expression method. Finding All Occurrences of a substring in a Python string The substrings are the characters of a string and ... Read More

Count of simple cycles in an undirected graph having N vertices

Pranavnath
Updated on 25-Aug-2023 15:47:19

434 Views

Introduction Undirected graphs are an essential component of computer science and graph theory, representing a group of nodes connected by edges without any directionality. One common problem associated with undirected graphs is the counting of simple cycles or circuits, which are closed paths that visit each vertex only once. In this article, we will explore how to get total count of the given undirected graph with N vertices using the powerful programming languages C and C++. Undirected Graph Before we jump into coding, let's ensure everyone grasps what constitutes a simple cycle within an undirected graph. Let us consider an ... Read More

DSatur Algorithm for Graph Coloring

Pranavnath
Updated on 25-Aug-2023 15:45:42

1K+ Views

Introduction Graph coloring may be an essential issue in graph hypothesis. The DSatur algorithm presents a compelling approach to play down the utilization of colors while performing chart coloring. By deliberately selecting vertices with the most noteworthy immersion degree, DSatur guarantees an optimized color task that maximizes color differing qualities and minimizes color utilization. In this article, we explore the DSatur calculation for chart coloring and its utilization utilizing C++. The calculation decides its title from the two key concepts it utilizes: Degree and Submersion. It considers the degrees of the vertices and their inundation degrees, which speak to the ... Read More

Length of Longest increasing sequence of nodes in a given Graph

Pranavnath
Updated on 25-Aug-2023 15:44:29

157 Views

Introduction In graph hypothesis, the user will understand to find the length of the longest expanding grouping of nodes in a specified graph. It includes deciding the longest way in a chart where each hub within the way features a strictly increasing esteem compared to its past node. In this article, we are going investigate three approaches to unravel this issue utilizing C++. Each approach will be clarified in detail, counting the calculation, step-by-step execution, and yield. To guarantee consistency, we'll utilize the same input for all three approaches, and they will create the same yield.  Approach 1: Depth-First Search ... Read More

Lexicographically smallest string formed by replacing characters according to the given relation

Pranavnath
Updated on 25-Aug-2023 15:43:30

1K+ Views

Introduction The task of making the lexicographically smallest string by replacing characters according to a given relation poses a captivating challenge in string control. The objective is to modify the characters inside the input string, following to the required substitution rules, in arrange to get the littlest lexicographic order. In this article, we'll focus on solving this issue utilizing C++. We are going investigate three approaches to handle this issue, each utilizing a one of a kind technique and algorithmic method. These approaches are planned to supply distinctive bits of knowledge into understanding the issue, considering variables such as effectiveness, ... Read More

How to Print Colored Text in Java Console?

Adeeba Khan
Updated on 25-Aug-2023 17:26:18

19K+ Views

When dealing with Java terminal apps, individuals may frequently want to print colored text to improve the output's aesthetic appeal and readability. ANSI escape codes can be used to generate colored text instead of the monochrome output that Java's default terminal generally produces. When printed to the console, ANSI escape codes are unique sets of characters that alter the text's appearance by altering its color, style, or background. In this article, we'll look at how to print colored text in the Java console using ANSI escape codes. We'll go over two examples, one with colored text only and the other ... Read More

Find if possible to visit every nodes in given Graph exactly once based on given conditions

Pranavnath
Updated on 25-Aug-2023 15:41:10

214 Views

Introduction Graph theory plays a crucial part in understanding a wide run of real-world issues, counting course optimization, organize examination, and task planning. One interesting issue inside graph theory is the seek for a Hamiltonian way, a way that visits each node in a graph exactly once. This issue has applications in zones such as circuit plan, DNA sequencing, and coordination’s arranging. In this article, we dig into the investigation of diverse approaches to decide on the off chance that it is conceivable to visit each hub in a given chart precisely once, based on certain conditions. We center on ... Read More

Advertisements