Search Insert Position | Search Problem | LeetCode 35

4 years ago Lalit Bhagtani 0
Problem Statement You have given a sorted array and a target value, write a program to search the target value in the sorted array. If the target value is found, then return its index otherwise return the index where it would be present if it is inserted in the sorted array. Note: Array contains no Read More

Max Consecutive Ones | Array Problem | LeetCode 485

4 years ago Lalit Bhagtani 0
Problem Statement You have given an integer array comprising of 1 and 0 integers only, write a program to find out the maximum number of consecutive 1’s in the given array. Example  Input :- Output :- 3 Input :- Output :- Read More

How to throttle function invocation in JavaScript | Lodash Library

4 years ago Lalit Bhagtani 0
JavaScript Throttle function invocation In this tutorial, we will learn about how to throttle function invocation in JavaScript. Throttle :- The Throttle is a technique in which a function is executed only once in a given interval of time, even when it is invoked multiple times. For example, a user clicks a button multiple times Read More

How to Deep and Shallow clone an object in JavaScript

4 years ago Lalit Bhagtani 0
JavaScript Deep and Shallow Clone of Object In this tutorial, we will learn about how to deep and shallow clone an object in JavaScript. Cloning The cloning of an object creates a new object containing all the fields and values of the original object. The value of a field can be of two types, a Read More

How to debounce function invocation in JavaScript | Lodash Library

4 years ago Lalit Bhagtani 0
JavaScript Debounce function invocation In this tutorial, we will learn about how to debounce function invocation in JavaScript. Debounce :- The Debounce is a technique to group multiple sequential events calls into one event call. This technique is used to handle a scenario, where the user is creating a large number of same events by performing Read More

JavaScript Filter Arrays – How to filter arrays in JavaScript

4 years ago Lalit Bhagtani 0
JavaScript Filter Arrays In this tutorial, we will learn about how to filter arrays in JavaScript. Array Filter Method :- JavaScript Array object contains a filter method, which can be used to filter the elements of an array. This method takes one predicate function which tests each element of the array and keeps the element if Read More

How to use array as queue in JavaScript – JavaScript Array

4 years ago Lalit Bhagtani 0
JavaScript Array as Queue In this tutorial, we will learn about how to use array as queue in JavaScript. Queue is linear data structure, which follows the Fist In First Out (FIFO) principle. The first element inserted into a stack is the first element removed from it. The Queue data structure provides the following operations: enqueue(N) Read More

How to use array as stack in JavaScript – JavaScript Array

4 years ago Lalit Bhagtani 0
JavaScript Array as Stack In this tutorial, we will learn about how to use array as stack in JavaScript. Stack is linear data structure, which follows the Last In First Out (LIFO) principle. The last element inserted into a stack is the first element removed from it. The Stack data structure provides the following operations: push(N) Read More

Design PriorityQueue using Binary Heap | Java with Generics

4 years ago Lalit Bhagtani 0
Problem Statement Design a Minimum/Maximum PriorityQueue data structure using Binary Heap data structure. The Queue data structure will supports the following operations: enqueue(N) :- It insert element N to the back of the queue. dequeue() :- It removes and returns the maximum/minimum element of the queue. peek() :- It returns (not remove) the maximum/minimum element Read More

Design Queue using Dynamic Array | Queue Problem | Java with Generics

4 years ago Lalit Bhagtani 0
Problem Statement Design a Queue (FIFO) data structure using Dynamic Array. The Queue data structure will supports the following operations: enqueue(N) :- It insert element N to the back of the queue. dequeue() :- It removes and returns the element from the front of the queue. peek() :- It returns (not remove) the element from Read More