Check If a String is Palindrome Using Two Pointer in C++

AYUSH MISHRA
Updated on 13-Nov-2024 16:48:04

14K+ Views

A palindrome is a word, phrase, number, or other sequence of characters that reads the same from both backward and forward sides. In strings, the palindrome strings are those strings that can be read the same from both left and right sides. In this article, we are going to learn how we can check if a given string is palindrome or not using the two-pointer technique in C++. Problem We are given a string, and we have to check if it is palindrome or not using the two-pointer method in C++. Example 1 ... Read More

Find Median with Given Mean and Mode in C++

AYUSH MISHRA
Updated on 13-Nov-2024 16:45:24

12K+ Views

Mean, Median, and Mode are fundamental statistical measures that are used to describe the central tendency and also explain the spread of the sheet. These three measures help in understanding the overall distribution of the data. In this article, we are going to learn how to find the Median if we are given the Mean and Mode of an array in C++. Problem Statement We are given an array of numbers, and we need to calculate the Median, in case when Mean and Mode of an array are given in C++. Example Input [5, 15, 25, 35, ... Read More

Read and Write a File Using JavaScript

Abdul Rawoof
Updated on 13-Nov-2024 16:05:23

82K+ Views

The read and write operations on a file can be done by using specific commands. The module required to perform these operations must be imported first. The required module is 'fs', which is called the File System module in Node.js Write Operation on a File After the File System file is imported then, the writeFile() operation is called. The writeFile() method is used to write into the file in JavaScript. Syntax writeFile(path, inputData, callBackFunc) Parameters The writeFile() function accepts three parameters as mentioned below. Path: The first parameter is the path of ... Read More

Check CPU Temperature on Linux

Satish Kumar
Updated on 13-Nov-2024 15:25:46

18K+ Views

Introduction Monitoring CPU temperature on a Linux system is essential for maintaining optimal performance and preventing hardware damage. The CPU (central processing unit) is the brain of your computer, and it generates heat as it processes data. Over time, this heat can cause your CPU to slow down or even fail altogether. By monitoring your CPU temperature, you can identify potential issues before they cause permanent damage to your system. Understanding CPU Temperature on Linux CPU temperature is a measure of how hot the processor is running and is an important metric for computer performance. The faster a processor works, ... Read More

Check CPU Utilization in Linux with Command Line

Satish Kumar
Updated on 13-Nov-2024 15:04:56

1K+ Views

Introduction Monitoring the performance of a Linux system is essential to ensuring that it is operating optimally. One of the key factors in determining the performance of a system is CPU utilization. CPU utilization refers to the percentage of time that the processor spends executing instructions from various processes and applications on the system. In Linux, there are numerous tools available for monitoring CPU utilization, but using command line tools provides a quick and efficient way to check this metric. Basic Command Line Tools for Checking CPU Utilization When it comes to monitoring CPU utilization with the command line in ... Read More

Check Debian Linux Version

Satish Kumar
Updated on 13-Nov-2024 14:58:01

2K+ Views

Introduction Debian Linux is an open-source operating system that is widely used in both personal and professional settings. It was first released in 1993 and has since then gained a reputation for being stable, secure, and reliable. Debian Linux comes with a wide range of software packages that can be easily installed and used by users. Due to its stability, Debian Linux is the preferred choice of many system administrators who need to run servers or other mission-critical applications. Checking Debian Linux Version using Command Line Interface (CLI) The Power of the CLI For those who are unfamiliar with it, ... Read More

Grayscaling of Images Using OpenCV in Python

SaiKrishna Tavva
Updated on 13-Nov-2024 14:29:19

4K+ Views

Grayscaling an image includes converting a color image into a grayscale image. By using OpenCV library in various methods we can convert the color image with (multiple color channels) into a grayscale image (with a single channel). Some of the common methods for greyscaling an image using OpenCV are as follows. cv2.cvtColor(): This function is used to convert an image from one space color to another. Pixel ... Read More

Longest Substring Without Repeating Characters in Python

SaiKrishna Tavva
Updated on 13-Nov-2024 14:25:57

7K+ Views

In Python, by using different methods we can find the longest substring without repeating characters, such as by using the Brute force approach which involves checking all the Substrings, and also by using the advanced Sliding window Two Pointer approach, which uses a Hashmap to store the indexes. Some Common Methods Some of the common approaches in Python to find the longest Substring Without Repeating Characters are as follows. Brute Force: Checks all possible substrings and verifies if they have all unique characters in the string. Sliding Window with Set: This approach tracks characters in the current substring ... Read More

Format Floating Number to Fixed Width in Python

SaiKrishna Tavva
Updated on 13-Nov-2024 13:50:54

6K+ Views

In Python formatting a floating point number to a fixed width can be done by using methods like Python's f-strings and the flexible format() method. Float formatting methods The two built-in float formatting methods are as follows f-strings: Convenient way to set decimal places, spacing and separators. str.format(): This method allows to formatting types inside the placeholders to control how the values are displayed. ... Read More

Init Subclass in Python

SaiKrishna Tavva
Updated on 13-Nov-2024 13:49:50

3K+ Views

In Python __init_subclass__ method is a special method that allows us to initialize or customization of class creation particularly for subclasses. Key Characteristics of __init_subclass__ Some of the Key aspects of '__init_subclass__' method are as follows Automatic Invocation: The __init_subclass__ method is automatically called during the creation of a subclass and no need to manually invoke this method. Customizable via Parameters: To pass additional information or configuration options ... Read More

Advertisements