Found 34489 Articles for Programming

Repeated Character Whose First Appearance is Leftmost

Sonal Meenu Singh
Updated on 01-Aug-2023 09:41:45

119 Views

Introduction In this tutorial, we will develop an approach to finding repeated characters in a string whose first appearance is leftmost. This means the character first appeared at the beginning of the string. To find out whether the first character repeats or not, we traverse the whole string and match each character to the first character of the string. To resolve the task we use the find(), length(), and end() functions of the C++ programming language. Example 1 String = “Tutorialspoint” Output = The repeating character is “t” In the above example, the leftmost character of the input ... Read More

How to Instantiate an Abstract Class in Java?

Way2Class
Updated on 31-Jul-2023 17:50:13

535 Views

An Abstract Class is a class which is declared under the ‘Abstract’ keyword in Java. Abstract classes are a concept of one of the four principles of Object Oriented Programming (OOP) known as ‘Inheritance.’ Inheritance refers to a characteristic of Java Classes where one class known as the ‘Sub-class’ can inherit all the properties of the parent class typically known as ‘Super-class.’ In Java, Abstract Classes refer to the base super class from which other sub classes can inherit. It can contain both abstract and non-abstract methods. Algorithm Step 1 − Identify the methods in the class that have ... Read More

Queries to check if string B exists as a substring in string A

Sonal Meenu Singh
Updated on 01-Aug-2023 09:38:52

136 Views

Introduction In this tutorial, we will see queries to check if string B exists as a substring of string A. A substring is a string that is part of the main string. In the Query array, there are some integer values, and the index of string A will be checked to see if those integer values match the substring B or not.We use C++ queries to find out whether B is a substring of A or not.In this approach, there is a string A and B is the substring of A. Queries in C++ are integer values represented in array ... Read More

Find the sum of the ascii values of characters which are present at prime positions

Sonal Meenu Singh
Updated on 01-Aug-2023 09:34:50

293 Views

Introduction In this tutorial, we will learn the concept of c++ to find the sum of ASCII values of the characters present in the prime position. Prime position means characters whose position is 2, 3, 5, or any other prime number. ASCII (American Standard Code for Information Interchange) values are unique numerical values for alphabets, letters, punctuation marks, and other characters used in coding. It is used for communication with computers as the computer does not understand human language. There are 128 ASCII values starting from 0 to 127. Capital and small alphabets have separate ASCII values. We will develop ... Read More

Drawing a Smiley in Java Applet

Way2Class
Updated on 31-Jul-2023 17:48:57

3K+ Views

Java Applet is an astounding resource that grants specialists to make smart representations and liveliness inside a web program. In this educational activity, we will examine how to draw a smiley face using Java Applet. We will cover the accentuation, little by little computation, and different ways of managing to accomplish this task. Close to the completion of this article, you will have an unquestionable understanding of how to make a smiley face using Java Applet. Syntax To draw a smiley face in Java Applet, we really want to utilize the Illustrations class, which gives techniques to draw different shapes ... Read More

DoubleUnaryOperator Interface in Java

Way2Class
Updated on 31-Jul-2023 17:34:59

67 Views

In the world of Java programming, interfaces assume an urgent part in characterizing gets that classes should stick to. One such interface point is the DoubleUnaryOperator interface, which was presented in Java 8 as a piece of the functional programming improvements. This interface point addresses a procedure on a single double-valued operand that delivers a double-valued result. In this article, we will explore the syntax, use, and different ways to deal with carrying out the DoubleUnaryOperator interface in Java. Syntax The syntax for the DoubleUnaryOperator interface is as per follows − @FunctionalInterface public interface DoubleUnaryOperator { double ... Read More

DoubleConsumer Interface in Java with Examples

Way2Class
Updated on 31-Jul-2023 17:32:00

74 Views

In Java, functional programming has acquired enormous fame because of its capacity to work on code and further develop code coherence. The DoubleConsumer interface point is a significant part of Java's functional programming worldview.It is a functional interface that accepts a double-valued argument and performs some operations on it. In this article, we will explore the syntax, usage, and examples of the DoubleConsumer interface in Java. Syntax The DoubleConsumer interface has a solitary conceptual strategy called accept, which takes a double value as its parameter. The syntax of the DoubleConsumer point of interface is as per the following: @FunctionalInterface ... Read More

Find max length odd parity substring

Sonal Meenu Singh
Updated on 31-Jul-2023 20:02:40

72 Views

Introduction In this tutorial, we develop an approach to finding the maximum length odd parity substring. Odd parity in a substring means the number of times 1 repeats in a string is odd. Parity in C++ defines the bit set number and is 1s in a number. There are two types of parity: even and odd. When the total number of “1” in a binary representation is odd it is known as an odd parity string. In this tutorial, we find the maximum length odd parity substring using C++ programming concepts. Implementation 1 String = 101100 Output = 6 ... Read More

Distinct palindromic sub-strings of the given string using Dynamic Programming

Sonal Meenu Singh
Updated on 31-Jul-2023 19:57:39

334 Views

Introduction In this tutorial, we discuss an approach to finding all possible palindrome substrings using the input string. To implement the approach for this task we use C++ programming language and its functions. A palindrome is a string that reads the same from the back and front. For example, Mom is a palindrome string. In this tutorial, we take a string and find all possible palindrome substrings from it. Example 1 String = abcaa Output The possible palindromic substrings are : a, b, c, aa, aaa, aba, and aca. In the above example, the input string can make ... Read More

How to conduct Grid search using python?

Jay Singh
Updated on 31-Jul-2023 19:02:10

113 Views

Optimizing hyper parameters in machine learning models requires the use of grid search. Model performance is greatly influenced by hyper parameters like regularization strength or learning rate. With grid search, a preset set of hyper parameters is methodically investigated to identify the configuration that produces the best outcomes. Grid search offers an easy-to-use interface for building a grid of hyper parameters and evaluating model performance via cross-validation, both of which can be done using Python's Scikit-learn module. Grid search automates the search for ideal hyper parameters, allowing machine learning practitioners to concentrate on crucial activities like feature engineering and model ... Read More

Advertisements