AmitDiwan has Published 11365 Articles

How to print Python dictionary into JSON format?

AmitDiwan

AmitDiwan

Updated on 11-Aug-2022 08:09:19

7K+ Views

The Python Dictionary can be easily displayed into JSON format using the json Python Module. The json module is a JSON encoder/decoder. JSON is JavaScript Object Notation, a lightweight text-based open standard designed for human-readable data interchange. The JSON format was specified by Douglas Crockford. It has been extended from ... Read More

Smallest possible length constituting greatest frequency in JavaScript

AmitDiwan

AmitDiwan

Updated on 27-Jun-2022 06:50:58

104 Views

ProblemWe are required to write a JavaScript function that takes in an array of numbers, arr, as the first and the only argument.Our function is supposed to find the smallest possible length of a (contiguous) subarray of the array arr, that has the same greatest frequency of any element as ... Read More

Java Program to Convert the local Time to GMT

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 12:12:28

2K+ Views

In this article, we will understand how to convert the local Time to GMT. Java does not have a built-in Date class, but we can import the java.time package to work with the date and time API. The package includes many date and time classes.Below is a demonstration of the ... Read More

Java Program to Display time in different country’s format

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 12:10:09

440 Views

In this article, we will understand how to display time in different country’s format. Java does not have a built-in Date class, but we can import the java.time package to work with the date and time API. The package includes many date and time classes.Below is a demonstration of the ... Read More

Java Program to Display Dates of Calendar Year in Different Format

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 12:00:29

275 Views

In this article, we will understand how to display dates of calendar year in different format. Java does not have a built-in Date class, but we can import the java.time package to work with the date and time API. The package includes many date and time classes.Below is a demonstration ... Read More

Java Program to Iterate over ArrayList using Lambda Expression

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 11:51:45

2K+ Views

In this article, we will understand how to iterate over ArrayList using lambda expression. The ArrayList class is a resizable array, which can be found in the java.util package. The difference between a built-in array and an ArrayList in Java, is that the size of an array cannot be modified.Below ... Read More

Java Program to Pass ArrayList as the function argument

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 11:42:18

4K+ Views

In this article, we will understand how to pass ArrayList as the function argument. The ArrayList class is a resizable array, which can be found in the java.util package. The difference between a built-in array and an ArrayList in Java, is that the size of an array cannot be modified.Below ... Read More

Java Program to Sort map by keys

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 11:09:59

430 Views

In this article, we will understand how to sort map by keys. The Java Map interface, java.util.Map, represents a mapping between a key and a value. More specifically, a Java Map can store pairs of keys and values. Each key is linked to a specific value.Below is a demonstration of ... Read More

Java Program to Check if a set is the subset of another set

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 11:07:46

878 Views

In this article, we will understand how to check if a set is the subset of another set. A Set is a Collection that cannot contain duplicate elements. It models the mathematical set abstraction. The Set interface contains only methods inherited from Collection and adds the restriction that duplicate elements ... Read More

Java Program to Calculate the difference between two sets

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 11:05:57

626 Views

In this article, we will understand how to calculate the difference between two sets. A Set is a Collection that cannot contain duplicate elements. It models the mathematical set abstraction. The Set interface contains only methods inherited from Collection and adds the restriction that duplicate elements are prohibited.Below is a ... Read More

Advertisements