- 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
Stacks are basic data structures that follow the Last in First Out principle also termed as LIFO. A stack has many use cases like organizing function calls and undoing actions. Often one might encounter a problem locating the biggest and smallest elements inside a stack, this article will demonstrate multiple methods to accomplish this task using Java. Understanding Stacks A stack is a linear data structure that allows operations at only one end, known as the top. The primary operations include: Push: Adding an element to the top of the stack. ... Read More
Steps to Send SMS Alerts Using Java In this article, we'll explore how to send SMS alerts to saved contacts using Java. We will guide you on how to Send SMS alerts using Java to saved or unsaved Contacts. Following are the steps to do so − Setting up an account with the SMS provider. Adding provider Java library to your project. Writing Java code to send the SMS. Let's elaborate on the above steps. Setting up Account First of all, we need to set up ... Read More
Explore our latest online courses and learn new skills at your own pace. Enroll and become a certified expert to boost your career.
Java program to find the smallest missing number
The smallest missing number is the smallest number that is missing from a stream of elements or in an Array. The stream may or may not contain continuous elements. If the stream is continuous then the smallest missing number is nothing but the Smallest Missing Number in a stream. In this section, we will discuss the various approaches to find a Smallest Missing Number in a stream of elements using Java programming language. Problem Statement Given a stream of integers find the smallest missing number from the stream. Input 1 arr=[1, 2, 3, 5, 6, 7, 8] Output 1 ... Read More
In this article, we will learn to find unique words in a string using the Map utility of Java because of its property that it does not contain duplicate keys. To find unique words first get all words in the array to compare each word, for this split string based on space/s. If other characters such as comma(, ) or full stop (.) are present then using required regex first replace these characters from the string. Insert each word of string as the key of Map and provide the initial value corresponding to each key as is unique if this ... Read More
In this article, we will learn how to retrieve the highest key stored in a TreeMap. We will create a simple Java program that demonstrates how to create a TreeMap, add key-value pairs to it, and then use the lastKey() method to find the highest key in the map. Problem Statement Write a Java program to get the highest key stored in TreeMap. Input {1=PHP, 2=jQuery, 3=JavaScript, 4=Ruby, 5=Java, 6=AngularJS, 7=ExpressJS} Output Highest key in TreeMap: 7 Steps The followingare the steps to get the highest key in TreeMap − First, import the classes. ... Read More
In this article, we will learn to swap two numbers using Java. We will use the Scanner class to get the user input and perform the swapping temporary variable. Read integers from users using the nextInt() method of the Scanner class. Steps to swap two integers Following are the steps to swap two numbers in Java− Import the Scanner class. Create a variable (temp), and initialize it with 0. Assign 1st number to temp. Assign the 2nd number to the 1st number. ... Read More
To rotate an element using CSS, is a powerful tool to control and enhance the visual presentation of a website. In this article, we will be understanding three different approaches to rotate an element Using CSS. We are having an image and a div box with text content written in it, our task is to rotate element using CSS. Approaches to Rotate an Element Using CSS Here is a list of approaches to rotate an element using CSS which we will be discussing in this article with stepwise explaination and complete example codes. Rotate using ... Read More
Using Python Programming to solve PDV work problems In cases of closed systems which are also called as systems where the identity of mass does not change, the system interacts with its surroundings either in terms of heat or work. In this article, we will be dealing with the non-dissipative work interaction which is also known as the PDV or displacement work. We will be using Python programming to solve these problems. But before we start, one should know the fundamental meaning of displacement work. The displacement work is evaluated as the integral of the path the system has taken ... Read More
To force PHP to use strings for array keys is quite easy, as in PHP array keys are automatically stored as integers if the array elements are numbers. If they are not numbers then it will cast to strings. Forcing PHP to Use strings for Array Keys Following are the ways to force PHP to use strings for array Keys Using php array() function Using json_encode() function Using php array() Function If you use the array() function and keep the first key in quotes it will take other keys as a string does not matter if you are ... Read More
We are given a String and an integer value. The integer indicates how many times we have to rotate the string in left and right direction. In the left rotation, move the String characters in anti-clockwise from the prefix side and add them to the suffix side. Similarly, in right rotation, move the characters of the given string in clockwise and pick the characters from the suffix and add them to the prefix of the string. In this article, we will implement the JavaScript program for the left rotation and right rotation of a given string. The length of ... Read More