Found 33676 Articles for Programming

How Java is Helpful for Artificial Intelligence (AI)?

Mr. Satyabrata
Updated on 31-Jan-2023 17:14:53

7K+ Views

Artificial Intelligence (AI) has been a hot topic for some time now & for good reason. AI has the potential to revolutionize many aspects of our everyday lives, from healthcare to education to transportation. The rise of artificial intelligence (AI), which has replaced all previous technologies, is being seen around the world. And one of the key technologies powering AI is Java. Exploring the Power of Java for AI Development Java is a popular programming language that was first released in 1995. It is known for its versatility & ease of use, which makes Java a great choice for AI ... Read More

Find Number of Array Elements Smaller than a Given Number in Java

Mr. Satyabrata
Updated on 31-Jan-2023 16:47:10

2K+ Views

An array is a linear data structure in which elements are stored in contiguous memory locations. As per the problem statement, finding number elements smaller than a given number means we need to compare and count only the smaller elements in the array. Let’s explore the article to see how it can be done by using Java programming language. To show you some instances Instance-1 Suppose we have the below array [10, 2, 3, -5, 99, 12, 0, -1] and the number is 9 Now the number of elements that are smaller than 9 are [2, 3, -5, 0, -1] ... Read More

Find Elements Greater Than a Given Number In a Subarray in Java

Mr. Satyabrata
Updated on 31-Jan-2023 16:36:13

676 Views

In Java, Array is an object. It is a non-primitive data type which stores values of similar data type. As per the problem statement we have given a sub array and a number and we have to find how many elements in this sub array are greater than that given number. So, we have to compare every element of the array with the given number and print the element if anyone is greater. Let’s explore the article to see how it can be done by using Java programming language. To Show you Some Instances Instance-1 Given Array= [12, 23, 34, ... Read More

Find All the Subarrays of a Given Array in Java

Mr. Satyabrata
Updated on 10-Dec-2024 19:15:48

54K+ Views

An array is a linear data structure in which elements are stored in contiguous memory locations. As per problem statement, we have to find all the subarrays of a given array. Subarrays are part or a section of an array. When we talk about all subarrays of an array, we talk about the total number of combinations that can be made using all the elements of the array without repeating. Let’s explore the article to see how it can be done by using Java programming language. To Show you Some Instances Instance-1 Suppose we have the below array [10, ... Read More

Find Array Elements Which has at Least One Smaller Element in Java

Mr. Satyabrata
Updated on 31-Jan-2023 15:28:10

237 Views

An array is a linear data structure in which elements are stored in contiguous memory locations. As per problem statement, we need to print all elements that have at least one smaller element. In simple terms we can say printing all elements of the array except the smallest one as the smallest one does not have any smaller element than this. Let’s explore the article to see how it can be done by using Java programming language. To Show You Some Instances Instance-1 Suppose we have the below array [10, 2, 3, -5, 99, 12, 0, -1] Now all elements ... Read More

What should you absolutely never do when using Python?

Vikram Chiluka
Updated on 31-Jan-2023 18:19:50

228 Views

In this article, we will learn what should never do when working with Python. Use Class Variables Carefully In Python, class variables are used as dictionaries and are referred to as Method Resolution Order (MRO). Furthermore, if a class lacks one attribute, then that class lacks a property. That is, if you modify what is in a class, other classes should not change as well. Improper Indentation In Python, indentation is everything. Python utilizes indentation online, unlike Java, C++, and other programming languages, which use curly brackets to construct code blocks. Many properties are affected by indentation. Some Python indentation ... Read More

Check One Array is Subset of Another Array in Java

Mr. Satyabrata
Updated on 31-Jan-2023 15:23:01

5K+ Views

In Java, Array is an object. It is a non-primitive data type which stores values of similar data type. As per the problem statement we have to check whether one array is subset of another array. An array is a subset of another array if all the elements of subarray is present in the given array. Let’s explore the article to see how it can be done by using Java programming language. To Show you Some Instances Instance-1 Suppose the original array is array1 {33, 51, 5, 31, 9, 4, 3} The sub array is array2 {51, 9, 33, 3} ... Read More

What is the use of the map function in Python?

Vikram Chiluka
Updated on 31-Jan-2023 18:13:16

2K+ Views

In this article, we will learn the uses of the map function in Python. What is a map() Function? Python's map() function applies a function to each item in an iterator that is provided as input. A list, tuple, set, dictionary or string can all be used as iterators, and they all return iterable map objects. Map() is a built-in Python function. Syntax map(function, iterator1, iterator2 ...iteratorN) Parameters function − It is necessary to provide a map with a function that will be applied to all of the iterator's available items. iterator − a mandatory iterable object. It ... Read More

What does '//' mean in python?

Vikram Chiluka
Updated on 31-Jan-2023 18:11:50

6K+ Views

In this article, we will learn about the // operator in Python in detail. To do floor division in Python, use the double slash // operator. This // operator divides the first number by the second number and rounds the result to the closest integer (or whole number). Syntax of // Operator To utilize the double slash // operator, follow the same steps as in regular division. The only difference is that you use a double slash // instead of a single slash / − Syntax first_number// second_number Floor Division Algorithm (Steps) Following are the Algorithm/steps to be followed ... Read More

What are some good Python examples for beginners?

Vikram Chiluka
Updated on 01-Feb-2023 19:57:35

310 Views

In this article , we will learn some useful basic Python examples for beginners in this article.This article also includes some basic questions that are asked in the python interview. Lets get started!!! How can I Make a Tuple out of a List? Using the Python tuple() method, we may convert a list to a tuple. We can't update the list after it's been converted to a tuple since tuples are immutable. Example The following program returns the converts the list into a tuple using tuple() function − # input list inputList = ['hello', 'tutorialspoint', 'python', 'codes'] # ... Read More

Advertisements