- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 34470 Articles for Programming
![Rushi Javiya](https://www.tutorialspoint.com/assets/profiles/576280/profile/60_2555583-1672217268.jpg)
416 Views
In this problem, we will find all palindromic substrings of the given length. There are two ways to solve the problem. The first way is to compare the characters of substring from start to last, and another way is to reverse the substring and compare it with the original substring to check whether the substring is palindrome. Problem statement − We have given a string alpha. We need to find all palindromic substrings of the given string. Sample Examples Input alpha = "abcd" Output 4 Explanation The palindromic substrings are ‘a’, ‘b’, ‘c’, and ‘d’. Input alpha ... Read More
![Rushi Javiya](https://www.tutorialspoint.com/assets/profiles/576280/profile/60_2555583-1672217268.jpg)
343 Views
In this problem, we will find two array elements such that the difference between them is maximum. We can make a pair of each element and find the difference between the elements of each pair. After that, we can take a pair whose element has a maximum difference. Another approach is to sort the array and take the largest and smallest element from the array. Problem statement − We have given an array containing the integer values. We need to find two array elements to maximize the difference between them. Sample Examples Input array[] = { 50, 10, 30, ... Read More
![Pradeep Kumar](https://www.tutorialspoint.com/assets/profiles/483469/profile/60_891162-1657084658.jpg)
3K+ Views
An operating system is in charge of controlling a computer system's resources and acting as an interface between the hardware and software. The management of events that arise during the execution of programmes is a crucial component of operating system design. Traps and interrupts are two often utilised methods for this purpose. A trap is a computer-generated occurrence that results from an error or exception in the programme that is running at the time. Division by zero, page errors, and illegitimate instructions are a few examples of traps. The CPU instantly enters kernel mode after a trap occurs and ... Read More
![Pradeep Kumar](https://www.tutorialspoint.com/assets/profiles/483469/profile/60_891162-1657084658.jpg)
2K+ Views
A well-liked programming paradigm called object-oriented programming (OOP) emphasizes the use of objects to represent and manipulate data. The ability to construct methods that can interact with these objects is one of the main characteristics of OOP. Class methods, static methods, and instance methods are the three different categories of methods in Python. Methods that belong to a class rather than an instance of that class include class methods and static methods. Class methods receive a reference to the class or instance as their first argument, but static methods do not. This is the primary distinction between them. ... Read More
![Rinish Patidar](https://www.tutorialspoint.com/assets/profiles/617319/profile/60_2434475-1678768874.jpg)
224 Views
The problem statement includes checking whether a K-sized very long positive integer is the multiple of 3 or not where each ith digit in the K-sized number where i>1 will be the sum of all the prefix digits modulo 10 from the left. We will be given two integers a0 and a1, where 1
![Rinish Patidar](https://www.tutorialspoint.com/assets/profiles/617319/profile/60_2434475-1678768874.jpg)
178 Views
The problem statement includes checking whether a number is Emirprimes or not, where the positive integer N will be the user input. An Emirpimes number is a semiprime number whose when digits are being reversed, gives a new number which too is a semiprime number. A semiprime number is a number which is the product of two prime numbers which can be either distinct or the same. In simple words, for a number N to be semiprime it should be of the form N=a*b, where a and b are prime numbers. They can be equal. In this problem, we will ... Read More
![Rinish Patidar](https://www.tutorialspoint.com/assets/profiles/617319/profile/60_2434475-1678768874.jpg)
185 Views
The problem statement includes checking the given numbers which will be the user input, if it is a Blum number or not. A Blum integer is a semiprime number whose distinct prime factors a and b are of the form 4t+3, where t is some positive integer. A semiprime number is a number which is a product of exactly two prime numbers or a natural number which has exactly two factors which are prime numbers. In case of semiprime numbers, the factors may be equal. In case any number N which is a blum integer, it must have only two ... Read More
![Sabid Ansari](https://www.tutorialspoint.com/assets/profiles/634897/profile/60_3421633-1680760954.jpg)
217 Views
Understanding and effectively utilizing Java's functional interfaces is an essential skill for any modern Java developer. Among these interfaces, the ToDoubleFunction interface is a significant tool that offers tremendous utility. This article aims to provide a comprehensive exploration of the ToDoubleFunction interface in Java, enriched with practical examples to enhance your understanding. What is the ToDoubleFunction Interface? Introduced in Java 8, the ToDoubleFunction interface is a part of the java.util.function package. It represents a function that accepts an argument of one type and produces a double-valued result. Its primary use is in lambda expressions and method references where a function ... Read More
![Sabid Ansari](https://www.tutorialspoint.com/assets/profiles/634897/profile/60_3421633-1680760954.jpg)
761 Views
Introduction In Java, the manipulation and handling of time is a common requirement in programming tasks. The TimeUnit class, part of java.util.concurrent package, plays a crucial role in this aspect by providing a set of methods for converting time across different units. In this article, we delve into the TimeUnit class, its applications, and practical examples to illustrate its usefulness. Understanding TimeUnit in Java The TimeUnit class in Java provides methods for time conversions and thread-sleep operations with better readability and precision than standard approaches. TimeUnit defines the following time units: DAYS, HOURS, MICROSECONDS, MILLISECONDS, MINUTES, NANOSECONDS, and SECONDS, each ... Read More
![Sabid Ansari](https://www.tutorialspoint.com/assets/profiles/634897/profile/60_3421633-1680760954.jpg)
207 Views
Introduction Java concurrency provides several classes and tools that allow developers to create multi-threaded applications. Among these are the ThreadPoolExecutor and Semaphore classes. The former is used to manage a pool of worker threads, while the latter can limit the number of threads accessing a certain resource at a given time. This article delves into throttling the task submission rate using these two Java classes. By understanding how to effectively manage threads and control their execution, you can significantly optimize your Java applications. Understanding ThreadPoolExecutor and Semaphore Before we jump into how to throttle the task submission rate, it's essential ... Read More