Articles on Trending Technologies

Technical articles with clear explanations and examples

Java program to find common elements in three sorted arrays

Shriansh Kumar
Shriansh Kumar
Updated on 16-Aug-2024 2K+ Views

The common elements in three sorted arrays are those elements that occur in all three of them. In this article, we will learn how to find common elements from three sorted arrays in Java. An example of this is given as follows − Example Scenario: Input 1: arr1 = [1, 3, 5, 7, 9] Input 2: arr2 = [2, 3, 6, 7, 9] Input 3: arr3 = [1, 2, 3, 4, 5, 6, 7, 8, 9] Output: Common elements = 3 7 9 Here, arrays are data structure which stores a fixed-size sequential collection of elements of the same ...

Read More

Java program to multiply given floating point numbers

Shriansh Kumar
Shriansh Kumar
Updated on 16-Aug-2024 2K+ Views

Suppose two floating point numbers are given as operands and your task is to write a Java program to multiply the given numbers. To perform this operation, initialize two float values, multiply and store the result in another float type variable. Float is a datatype in Java which stores numbers with fractional part. Example Scenario: Input 1: num1 = 1.2 Input 2: num2 = 1.4 Output: product = 1.68 Using Multiplication Operator The multiplication operator is represented by asterisk sign (*). It is categorized under arithmetic operator in Java. It can be used to multiply float values ...

Read More

Java Program to get day of week as string

Shriansh Kumar
Shriansh Kumar
Updated on 16-Aug-2024 3K+ Views

Some applications that work on calendars require a day name to be displayed for features like scheduling tasks, events or reminders. For this purpose, Java provides various built-in classes and methods including LocalDate, Calendar and SimpleDateFormat. In this article, we will learn how to use these classes and methods in Java programs to find the day name of a week for a given date. Using LocalDate Class In this approach, we first find current date using LocalDate class and using its built-in method named getDayOfWeek(), we create a DayOfWeek Enum which can be converted to String to display day ...

Read More

Java program to join two given lists

Arjun Thakur
Arjun Thakur
Updated on 14-Aug-2024 3K+ Views

To join two given lists the addAll() method of the java.util.ArrayList class is used to insert all of the elements in the specified collection into this list. To add contents of a list to another − Problem Statement Write a program in Java to join two given lists − Input Contents of list1 ::[Apple, Orange, Banana] Contents of list2 ::[Grapes, Mango, Strawberry] Output Contents of list1 after adding list2 to it ::[Apple, Orange, Banana, Grapes, Mango, Strawberry] Steps to join two given lists Following are the steps to join two given lists − ...

Read More

Subarray with given sum in Java with different approaches

Areeba Rashid
Areeba Rashid
Updated on 14-Aug-2024 426 Views

Finding a subarray with a given sum is a common problem that often appears in coding interviews and competitive programming. This problem can be solved using various techniques, each with its own trade-offs regarding time complexity and space complexity. In this article, we'll explore multiple approaches to solving the problem of finding a subarray with a given sum in Java. Problem Statement Given an array of integers and a target sum, find a continuous subarray in the array that adds up to the given sum. The problem can be divided into two main variants: Subarray ...

Read More

Java program to remove duplicates from a given stack

Anh Tran Tuan
Anh Tran Tuan
Updated on 14-Aug-2024 663 Views

In this article, we’ll explore two methods to remove duplicate elements from a stack in Java. We’ll compare a straightforward approach with nested loops and a more efficient method using a HashSet. The goal is to demonstrate how to optimize duplicate removal and to evaluate the performance of each approach. Problem statement Write a Java program to remove the duplicate element from the stack. Input Stack data = initData(10L); Output Unique elements using Naive Approach: [1, 4, 3, 2, 8, 7, 5] Time spent for Naive Approach: 18200 nanoseconds Unique elements using Optimized Approach: [1, 4, 3, 2, ...

Read More

Difference between Kimball and Inmon

Shirjeel Yunus
Shirjeel Yunus
Updated on 13-Aug-2024 580 Views

One of the important aspects of business development is the design of a Data Warehouse in which a schema is used to collect different data sources. The two popular architectures used to design a data warehouse are Kimball and Inmon. In this article, we will discuss the difference between Kimball and Inmon. What is Kimball? Ralph Kimball introduced the Kimball approach to design a data warehouse. This is an approach in which business processes and questions are recognized and the answer to these questions has to be given by the data warehouse. The information provided by the data warehouse is ...

Read More

Difference between Apache Tomcat Server and Apache Web Server

Shirjeel Yunus
Shirjeel Yunus
Updated on 13-Aug-2024 556 Views

Apache Software Foundation is the company that owns the Apache Tomcat Server and Apache Web Server. Apache Tomcat Server works as a container for Java Servlet and Apache Web Server is an HTTP server. Many users get confused between both of these servers. In this article, we will discuss the difference between Apache Tomcat Server and Apache Web Server. What is Apache Tomcat Server? Apache Tomcat is a server which works as a container for Java Servlets. Apache Tomcat Server was developed in 1998 and now it has become one of the best JavaScript web hosting solutions. It is also ...

Read More

Difference Between Artificial Intelligence and Software Development

Vijayendra Prasad
Vijayendra Prasad
Updated on 13-Aug-2024 362 Views

Software and artificial intelligence are two major concerns of this present technological shift. While both pertain to the making of software systems, they differ in their purpose, methods, and the outcome of the work to be done within them. A person looking to have a professional career in or business application with technology must understand this important difference. What is Artificial Intelligence? Artificial intelligence, commonly called AI, is the sub-branch of Computer Science that deals with developing systems with the capability for tasks usually handled by human intelligence. Tasks include learning from experience and reasoning, understanding of natural language, ...

Read More

Difference between BPO and KPO

Shirjeel Yunus
Shirjeel Yunus
Updated on 13-Aug-2024 365 Views

Businesses like to outsource different processes so that the efficiency of the employees and the companies can be increased. Outsourcing also helps in reducing the cost of hiring and training employees and giving them salaries. The process of outsourcing is available for business and knowledge processes and in this article, we will discuss the difference between BPO and KPO. What is KPO? The full form of KPO is Knowledge Process Outsourcing. It is a type of outsourcing in which different processes are outsourced. Some of them are listed below − Research and development ...

Read More
Showing 32021–32030 of 61,297 articles
Advertisements