Search an Element in a Sorted and Rotated Array in Java

Shriansh Kumar
Updated on 05-May-2023 18:04:44

447 Views

Suppose you have a sorted array with no duplicate values and from a certain index this array is rotated. You have to search for a particular element in it. If it is available in the array then return the index otherwise return -1. In this article, we will solve the given problem using two approaches Linear search and Binary search. Approach 1: Using Linear Search This approach will search for the given element in sequential manner. Algorithm Step 1 − First, declare and initialize an array named ‘araylist’ and an integer variable named ‘searchElem’ that we are going ... Read More

StringJoiner Class vs String Join Method in Java

Shriansh Kumar
Updated on 05-May-2023 18:01:43

755 Views

There are numerous ways of joining strings in java. The StringJoiner class and String.join() method are two of them. Both are used to join two or any number of strings but the difference lies in their implementation. In this article, we will try to find the differences that exist in the usage of StringJoiner class and String.join() method. StringJoiner Class It is a class available in java.util package and it is added from JDK 8. We can join multiple strings at a time. Before using, it is necessary to import it into our program using the following command ... Read More

Scanner and nextChar in Java

Shriansh Kumar
Updated on 05-May-2023 17:59:18

5K+ Views

Scanner is a class available in ‘java.util’ package used to take input from numerous sources like a file, or console. The most common source of taking input is from standard input i.e. keyboard. The scanner class has few methods to take input of primitives and strings from the keyboard. We will understand scanner class and its various methods through this article. Scanner and nextChar() The following methods of Scanner class is used to take input − nextInt() − To take integer as an input. nextLong() − To take long as an input. nextDouble() − To take double as an ... Read More

String Arrays in Java

Shriansh Kumar
Updated on 05-May-2023 17:57:50

1K+ Views

String and Arrays are two distinct things. Array is a linear data structure that is used to store group of elements with similar datatypes but a string is a class in Java that stores a series of characters. Those characters are actually String-type objects. Since strings are objects we can say that string arrays are group of string-type objects. In this article, we will understand string arrays in java and perform some operations on them. String Arrays The string array is a combination of array and string both. Therefore, it has the properties of both array and string such ... Read More

Storage of String in Java

Shriansh Kumar
Updated on 05-May-2023 17:55:07

423 Views

A string is a class in Java that stores a series of characters. Those characters are actually String-type objects. The value of string is enclosed within double quotes. The string class is available in java.lang package. In this article, we will look into the storage mechanism of strings in java. String and Storage of String To create strings − Syntax String nameOfobject = “ values ”; Instance 1 String st1 = “Tutorix and Tutorialspoint”; Here, ‘st1’ is the reference variable and its values are in double quotes. We can also use new keyword to create ... Read More

Deploy a Basic Static HTML Website to Heroku

Aayush Mohan Sinha
Updated on 05-May-2023 17:49:14

2K+ Views

Conveying a stationary HTML website to a hosting platform can be an intimidating feat, especially for fledgling web developers. However, the emergence of cloud hosting amenities like Heroku has streamlined and made the process more approachable. Heroku, a cloud-oriented platform-as-a-service (PaaS), provides a straightforward and productive technique for deployment and management of web-based applications. This composition entails a comprehensive walkthrough of the step-by-step method of deploying a fundamental stationary HTML website to Heroku, utilizing the Heroku Command Line Interface (CLI) and Git, while concurrently discussing the various configuration options accessible to developers. By abiding by the instructions outlined in this ... Read More

Demonstrate AJAX Loading Data in DataTables

Aayush Mohan Sinha
Updated on 05-May-2023 17:47:44

2K+ Views

In the realm of web development, the ability to efficiently load data using Ajax can be a game-changer for user experience. DataTables, a powerful jQuery plugin for creating dynamic and responsive data tables, offers a straightforward approach to incorporating Ajax loading into data tables. However, some developers may find the process of integrating Ajax loading into their DataTables challenging. In this article, we will explore the step-by-step approach to demonstrating the use of Ajax loading data in DataTables, delving into the underlying concepts and syntax necessary for success. By following this guide and utilizing the various parameters available within DataTables, ... Read More

Trends in Center-State Relations: An Overview

Naresh Soni
Updated on 05-May-2023 17:44:03

201 Views

Introduction Right now, we can see the smooth Center & States relations in India. No wonder these relations was not that smooth in earlier days of Independence. There was an entire trend of these relations that took around 70+ years of dedication and hard-work. Understanding the Trends in Center State Relations is important for a polity student to understand present relations of center and states and their reason behind to it. If you are also here to know about the same, then be with us till the end of this article, because we have provided all the related information about ... Read More

Overview of Sarkaria Commission Recommendations and Observations

Naresh Soni
Updated on 05-May-2023 17:40:37

490 Views

Introduction The term “Sarkaria Commission”, have its own depth and weight in the history of Indian polity with regarding of the center states relations in India. It is a most important topic for any student or Candidate who studying Indian polity. There were many suggestions or recommendations by the Sarkaria commission that was implemented by the Government of India so far. If you are a candidate who is preparing for the government exam in India and also want to increase the deep knowledge about Sarkaria commission and its recommendations, then please read this article entirely for your own benefits. ... Read More

Delete Text from Document Using HTML

Aayush Mohan Sinha
Updated on 05-May-2023 17:39:32

820 Views

In the domain of web development, the capacity to handle text within a file is an indispensable expertise for designing interactive and captivating user interfaces. HTML, the widely recognized coding language utilized for making web pages, furnishes developers with a variety of mechanisms for removing text from a file. Although this may appear to be a simple task, apprehending the fundamental syntax and aspects implicated is fundamental for producing top-quality web applications. In this composition, we shall scrutinize the incremental process of eliminating text from a document utilizing HTML, contemplating on the diverse approaches and deliberations that developers ought to ... Read More

Advertisements