Found 33370 Articles for Programming

Java Program for Left Rotation and Right Rotation of a String

Prabhdeep Singh
Updated on 11-Jul-2023 08:55:14
Rotation means we have to shift each character either in a forward direction or backward direction. Forward direction means right rotation (Or anticlockwise) and backward direction means left rotation (Or clockwise). In this problem, we have given a string of characters of size n and integer d. Here d is less than n. Our task is to print the left rotated string or right rotated string by d integer. Only the permutation of the current string changes, not the length or frequency of the characters in the given string. Input 1 str = “apple”, d = 2 Output 1 Left ... Read More

Sort a string without altering the position of vowels

Prabhdeep Singh
Updated on 11-Jul-2023 09:02:29
Sorting a string means we have to arrange a given string either in an ascending or descending order or any given order. In this problem given a string 'str' of size n. Our aim is to sort the given string without altering means without changing the position of vowels present in the string. Let's see examples with explanations below to understand the problem in a better way. Sample Examples Input 1 str = “abdecokfee” Output 1 abcedofkee Explanation Constant present in the string = bdckf Sort the constant string = bcdfk Merge the given string with the sorted instant string ... Read More

Maximum Number of 0s Placed Consecutively at the Start and End in any Rotation of a Binary String

Prabhdeep Singh
Updated on 11-Jul-2023 09:00:04
Binary string means the string contains only two types of char either 1 or 0. It is known as base 2. In this problem, we have given a binary string str and also the size of the string 'n'. Our task is to find the maximum number of zeros places consecutively at the start and end of any rotation of a binary string. Let's see examples with explanations below to understand the problem in a better way. Sample Example Input 1 str = “101001, n = 6 Output 1 2 Explanation The string can be rotated in any of the ... Read More

C++ Program for Left Rotation and Right Rotation of a String

Prabhdeep Singh
Updated on 11-Jul-2023 08:56:40
Rotation means we have to shift each character forward or backward direction. In the case of forward, the last character is forwarded to the index 0 also known as right rotation. In the case of backward first character at index 0 is backward to the last index also known as left rotation. In this problem, we have given a string of characters and integer d. Our task is to print the left rotated string or right rotated string by d integer. Only the permutation of the current string changes, not the length or frequency of the characters in the ... Read More

Difference Between CORBA and RMI

Md. Sajid
Updated on 10-Jul-2023 19:37:31
CORBA (Common Object Request Broker Architecture) and RMI (Remote Method Invocation) are middleware technologies used in Java to support distributed computing. CORBA (Common Object Request Broker Architecture) is a middleware technology that allows distributed objects in a networked environment to communicate with one another. RMI (Remote Method Invocation) is a middleware technology that allows Java objects to invoke methods on remote JVM (Java Virtual Machine) objects. Read this article to find out more about CORBA and RMI and how they are different from each other. What is CORBA? CORBA (Common Object Request Broker Architecture) is a middleware technology that allows ... Read More

How To Track ISS (International Space Station) Using Python?

Tushar Sharma
Updated on 10-Jul-2023 19:31:33
Exploring the whereabouts of the International Space Station (ISS) and witnessing its real−time movements can be an exhilarating experience. The following article aims to showcase how Python can be utilized to track the ISS, utilizing the ISS API provided by Open Notify and visualizing its location on an interactive world map with the aid of the `folium` library. Installing the Required Libraries Before we embark on our ISS tracking journey, it is necessary to install a couple of libraries: `requests`, which facilitates API calls, and `folium`, which empowers the creation of captivating interactive maps. pip install requests ... Read More

How to Throttle API with Django Rest Framework

Tushar Sharma
Updated on 10-Jul-2023 19:28:16
In the realm of building APIs using the renowned Django Rest Framework (DRF), one must skillfully navigate the challenges posed by managing the rate at which clients can unleash their torrent of requests upon your API endpoints. Throttling mechanisms come to the rescue by effectively safeguarding against potential abuse, protecting precious resources, and fostering an environment of equitable usage among clients. In this in−depth discourse, we shall embark upon an enlightening journey, exploring the multifaceted realm of implementing throttling techniques within your DRF−powered API. Brace yourself for a captivating exploration of the built−in throttling classes at your disposal, as well ... Read More

How to test Typing Speed using Python?

Tushar Sharma
Updated on 10-Jul-2023 19:25:10
If you've ever pondered the swiftness at which you can type or desire to refine your typing prowess, we possess a solution tailor−made for you! Within the confines of this composition, we shall delve into a simple approach that entails evaluating your typing speed utilizing Python. Fret not if you find yourself at the nascent stages of programming or if technical jargon leaves you feeling bewildered. We shall meticulously expound upon every facet using easily comprehensible verbiage, elucidating the process step by step. Step 1: Embarking on a Pythonic Journey To commence this undertaking, it is imperative to ensure that ... Read More

How to Terminate a Running Process on Windows in Python?

Tushar Sharma
Updated on 10-Jul-2023 19:20:22
When delving into the realm of Python development on a Windows operating system, there will undoubtedly be occasions where the need arises to terminate a running process. The motives behind such termination could span a wide array of scenarios, including unresponsiveness, excessive resource consumption, or the mere necessity to halt script execution. In this comprehensive article, we shall explore various methods to accomplish the task of terminating a running process on Windows using Python. By leveraging the 'os' module, the 'psutil' library, and the `subprocess` module, we will equip ourselves with a versatile toolkit to address this imperative task. Method ... Read More

How to take Column-Slices of DataFrame in Pandas?

Tushar Sharma
Updated on 10-Jul-2023 18:54:52
Pandas, an influential Python library renowned for its data manipulation and analysis capabilities, offers an array of tools to empower data scientists and analysts alike. Among its key data structures, the DataFrame stands tall−a two−dimensional labeled data structure with columns of potentially diverse types. When traversing the vast landscape of DataFrames, it frequently becomes necessary to extract specific columns or a range of columns, an art commonly referred to as column−slicing. In this article, we embark on a journey to explore various methods that unveil the secrets of taking column−slices in Pandas. Brace yourself for an expedition through the following ... Read More
1 2 3 4 5 ... 3337 Next
Advertisements