Krantik Chavan has Published 308 Articles

DoubleStream empty() method in Java

Krantik Chavan

Krantik Chavan

Updated on 30-Jul-2019 22:30:25

27 Views

The empty() method of the DoubleStream class in Java returns an empty sequential DoubleStream.The syntax is as follows:static DoubleStream empty()To use the DoubleStream class in Java, import the following package:import java.util.stream.DoubleStream;Let us create an empty DoubleStream:DoubleStream doubleStream = DoubleStream.empty();Now, let us check the number of elements in the stream. It ... Read More

C++ Program to Implement Euler Theorem

Krantik Chavan

Krantik Chavan

Updated on 30-Jul-2019 22:30:25

365 Views

This is a C++ Program which demonstrates the implementation of Euler Theorem. The number and modular must be coprime for the modular multiplicative inverse to exist.AlgorithmBegin Take input to find modular multiplicative inverse Take input as modular value Perform inverse array ... Read More

ArrayBlockingQueue poll() Method in Java

Krantik Chavan

Krantik Chavan

Updated on 30-Jul-2019 22:30:25

101 Views

The poll() method of the ArrayBlockingQueue class in Java retrieves and removes the head of this queue, or returns null if this queue is empty.The syntax is as follows:E poll()To work with ArrayBlockingQueue class, you need to import the following package:import java.util.concurrent.ArrayBlockingQueue;The following is an example to implement poll() method ... Read More

C++ Program to Implement Extended Euclidean Algorithm

Krantik Chavan

Krantik Chavan

Updated on 30-Jul-2019 22:30:25

1K+ Views

The Extended Euclidean Algorithm is just a another way of calculating GCD of two numbers. It has extra variables to compute ax + by = gcd(a, b). It's more efficient to use in a computer programAlgorithmBegin Declare variable a, b, x and y gcdExtended(int ... Read More

The clone() method of CopyOnWriteArrayList method in Java

Krantik Chavan

Krantik Chavan

Updated on 30-Jul-2019 22:30:25

111 Views

To return a shallow copy of the CopyOnWriteArrayList, use the clone() method.The syntax is as follows:public Object clone()To work with CopyOnWriteArrayList class, you need to import the following package:import java.util.concurrent.CopyOnWriteArrayList;The following is an example to implement CopyOnWriteArrayList class clone() method in Java:Example Live Demoimport java.util.concurrent.CopyOnWriteArrayList; public class Demo {    public ... Read More

How to add elements in Java ArrayBlockingQueue?

Krantik Chavan

Krantik Chavan

Updated on 30-Jul-2019 22:30:25

69 Views

To add elements to the ArrayBlockingQueue class, use the add() method.The syntax is as follows:boolean add(E ele)Here, ele is the element to be added to the queue.To work with ArrayBlockingQueue class, you need to import the following package:import java.util.concurrent.ArrayBlockingQueue;The following is an example to add elements in Java ArrayBlockingQueue class:Example Live ... Read More

Mode 1—strobed I/O

Krantik Chavan

Krantik Chavan

Updated on 30-Jul-2019 22:30:25

1K+ Views

We call mode 1 as the strobed Input Output or handshake Input Output. We use this mode when the data is supplied by the input device to the microprocessor at irregular interval of time. A port which is functioned to program in mode uses three handshake signals. These handshake signals ... Read More

Mode 2—bi-directional I/O

Krantik Chavan

Krantik Chavan

Updated on 30-Jul-2019 22:30:25

842 Views

In mode 0 or mode 1, a port works as an input port or an output port. It is dependent if an input device or an output device gets connected to the port. Moreover, this, mode 2 is often called as bi-directional handshake Input Output. It is beneficial for us ... Read More

C++ Program to Compute Discrete Fourier Transform Using Naive Approach

Krantik Chavan

Krantik Chavan

Updated on 30-Jul-2019 22:30:25

3K+ Views

In discrete Fourier transform (DFT), a finite list is converted of equally spaced samples of a function into the list of coefficients of a finite combination of complex sinusoids. They ordered by their frequencies, that has those same sample values, to convert the sampled function from its original domain (often ... Read More

C++ Perform to a 2D FFT Inplace Given a Complex 2D Array

Krantik Chavan

Krantik Chavan

Updated on 30-Jul-2019 22:30:25

651 Views

Fast Fourier transform (FFT) is an algorithm to compute the discrete Fourier transform (DFT) and its inverse. Basically Fourier analysis converts time (or space) to frequency and vice versa. A FFT rapidly computes transformations by factorizing the DFT matrix into a product of sparse (mostly zero) factors.AlgorithmBegin    Declare the ... Read More

Advertisements