163 subscribers
3.42K photos
24 videos
39 files
371 links
Link: @java_posts

Contact: java.response.email@gmail.com
Download Telegram
Media is too big
VIEW IN TELEGRAM
Java Management Service

Java Management Service (JMS) is a reporting and management service within Oracle Cloud Infrastructure (OCI). JMS can track Java usage running on OCI; on on-premises desktops, laptops, and servers; and on third-party cloud services. It also monitors the Java Development Kit, Java Runtime Environment, and GraalVM. We give an overview, vision, roadmap, architecture, and demo of JMS capabilities.
Pattern 6
#Source_code
#42
Pattern 7
#Source_code
#43
Pattern 8
#Source_code
#43
Pattern 9
#Source_code
#44
Media is too big
VIEW IN TELEGRAM
Java Modules in Real Life
Get advice on why, when, when not,and how to use Java modules in real life for your Java projects.
Pattern 10
#Source_code
#45
Pattern 11
#Source_code
#46
Find the Duplicate element in a limited range array
Given a limited range array of size n containing elements between 1 and n-1 with one element repeating, find the duplicate number in it without using any extra space.

#Data_structure
Java
Find the Duplicate element in a limited range array Given a limited range array of size n containing elements between 1 and n-1 with one element repeating, find the duplicate number in it without using any extra space. #Data_structure
Using Hashing
The idea is to use hashing to solve this problem. We can use a visited boolean array to mark if an element is seen before or not. If the element is already encountered before, the visited array will return true.
#Data_structure
#Source_code
Java
Find the Duplicate element in a limited range array Given a limited range array of size n containing elements between 1 and n-1 with one element repeating, find the duplicate number in it without using any extra space. #Data_structure
Using Array Indices
We can solve this problem in constant space. Since the array contains all distinct elements except one and all elements lie in range 1 to n-1, we can check for a duplicate element by marking array elements as negative using the array index as a key. For each array element nums[i], invert the sign of the element present at index nums[i]. Finally, traverse the array once again, and if a positive number is found at index i, then the duplicate element is i.

The above approach takes two traversals of the array. We can achieve the same in only a single traversal. For each array element nums[i], invert the sign of the element present at index nums[i] if it is positive; otherwise, if the element is already negative, then it is a duplicate.

#Data_structure
#Source_code