Problem Description In this problem, we are given a temperature value in Fahrenheit and we have to convert it to Celsius. This conversion is used in various real-world applications such as weather applications, scientific calculations, and data analysis. In this article, we are going to discuss, how we can convert Fahrenheit temperature to Celsius temperature in Python. Formula to Convert Fahrenheit to Celsius The formula for converting Fahrenheit to Celsius is: Celsius = (Fahrenheit - 32) / 1.8 Example 1 Input: Fahrenheit = 98.6 Output: Celsius = 37°C Explanation: The ... Read More
Problem Description In this problem, we are given an unsorted array, and the task is to remove all duplicate elements from the array. The resulting array should only contain unique elements. In this article, we are going to explore different approaches to removing duplicates from an unsorted array in C++. Example 1 Input: array = {4, 3, 2, 4, 1, 3, 2} Output: {4, 3, 2, 1} Explanation: The duplicate elements (4, 3, 2) are removed, leaving only unique elements. Example 2 Input: array ... Read More
This sheet provides a wide range of questions on data structures and algorithms. It includes dynamic and trending topics that match industry-level requirements. Firstly, you have to learn any programming language like C, C++, Java, etc. and after getting a better understanding of the concepts and language specifics, practice these questions for the mastery of DSA. Here is a list of topics featuring the most frequently asked problems in Data Structures and Algorithms: Array String Stack Queue Linked List ... Read More
To implement left rotation and right rotation of a string, we can use various approaches to implement this problem. Left rotation of a string means anti-clockwise movement of the given number of characters and right rotation of the string means clockwise movement of the given number of characters. In this article we are having a string and a value of k by which we will rotate the string. Our task is to write a JavaScript program for left rotation and right rotation of a string. Example Input: String str = "apple"; k = 3 Output: Left Rotation: ... Read More
Technology has grown exponentially in the last few decades. Additionally, technological use is on the rise. It has an impact on people's lives; technology affects their communication, learning, and thought processes. It has a significant impact on society, and it is difficult to see modern life without technology. Society and technology are interrelated, linked, and mutually beneficial. In both positive and negative ways, technology affects society, including its ability to advance or decline. Impact of Technology on Society Since technological systems like computers, TVs, and cell phones are created by humans and represent the demands and lifestyle of a population, ... Read More
A calculator is a simple tool that helps us to calculate mathematical operations easily and quickly. A basic calculator can perform simple arithmetic operations like subtraction, addition, multiplication, and division. Begin by writing the C code to create a simple calculator. Then, follow the algorithm given below to write a C program. Algorithm Step 1: Declare variables Step 2: Enter any operator at runtime Step 3: Enter any two integer values at runtime Step 4: Apply switch case to select the operator: // case '+': result = num1 + num2; ... Read More
In this article, we will learn to reverse an array in Java. Reversing an array is a classic problem that helps understand essential concepts like data structures and in-place manipulation. This operation is commonly required in programming tasks, such as data transformations, algorithm implementations, and solving logical problems. Problem Statement Reversing an array involves rearranging its elements so that the first element becomes the last, the second becomes the second-to-last, and so on. Input int[] myArray = {23, 93, 56, 92, 39}; Output {39, 92, 56, 93, 23} Different Approaches Following are the two different approaches to reverse an array ... Read More
In this article, we will learn to create an array from JSON data in JavaScript. JSON is a widely used format for storing and exchanging data. A common use case involves extracting specific data from a JSON object or array and converting it into a separate array for further processing. What is JSON Data? JSON (JavaScript Object Notation) is a lightweight data format commonly used to store and exchange data between a server and a client. It represents data as key-value pairs and is easy for both humans and machines to read and write. In JavaScript, JSON objects or arrays can be ... Read More
The ResultSet interface in Java is used to retrieve data from a database in a tabular form. The isAfterLast() method is one of the navigation methods in the ResultSet that helps in checking the position of the cursor. Specifically, isAfterLast() checks whether the cursor is positioned after the last row of the result set. Method Definition The isAfterLast() method of the ResultSet interface is used to determine whether the cursor is after the end of the ResultSet.This method returns a boolean this value is true, if the cursor is after the end of the ResultSet else, it returns false. ... Read More
What is Potential Energy? Potential energy is a type of stored energy stored by an object due to its position relative to other objects. It is an important concept in physics and is commonly calculated when studying objects in gravitational fields. In this tutorial, we are going to learn how to calculate the potential energy of an object in C++ if the mass and height are given. Formula for Calculating Potential Energy The formula for potential energy is as follows: Potential Energy = m × g × h Where:m is the mass of the object (in kilograms).g is the gravitational ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP