We all know about Stacks also known as Last-In-First-Out(LIFO) structures. Stack primarily has two main operation namely push and pop, where push inserts an ele
Given an array of elements, task is to sort these elements using stack. Prerequisites : Stacks Examples : Input : 8 5 7 1 9 12 10 Output : 1 5 7 8 9 10 12 Expla
Input: A array arr[] of two elements having value 0 and 1 Output: Make both elements 0. Specifications: Following are the specifications to follow. 1) It is gua
You have an array of N numbers, where N is at most 32,000. The array may have duplicates entries and you do not know what N is. With only 4 Kilobytes of memory
Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers. Examples: Inp
Both Arrays and Linked List can be used to store linear data of similar types, but they both have some advantages and disadvantages over each other. Key Differe
Given two arrays with size n, maximize the first array by using the elements from the second array such that the new array formed contains n greatest but unique
Given an array of n-positive elements. Sub-array sum is defined as the sum of all elements of a particular sub-array, the task is to find the sum of all unique
A Binary Heap is a Complete Binary Tree. A binary heap is typically represented as array. The representation is done as: The root element will be at Arr[0]. Bel
There are two players A and B who are interested in playing a game of numbers. In each move a player pick two distinct number, let’s say a1 and a2 and then re
Given a pair-sum array and size of the original array (n), construct the original array. A pair-sum array for an array is the array that contains sum of all pai
Given an array arr[0 . . . n-1]. We need to efficiently find the minimum and maximum value from index qs (query start) to qe (query end) where 0 <= qs <= qe <=
We strongly recommend to read following post on suffix trees as a pre-requisite for this post. Pattern Searching | Set 8 (Suffix Tree Introduction) A suffix arr
Write a function rotate(ar[], d, n) that rotates arr[] of size n by d elements. Rotation of the above array by 2 will make array Recommended: Please try your ap
Problem – Write a program in 8086 microprocessor to determine modulus of corresponding 8 bit n elements of first array with 8-bit n numbers of second array, w
An array is a group of like-typed variables that are referred to by a common name. And each data item is called an element of the array. The data types of the e
An array is a group of like-typed variables that are referred to by a common name. And each data item is called an element of the array. Equals(Object) method w
Array.LongLength Property is used to get a 64-bit integer that represents the total number of elements in all the dimensions of the Array. Syntax: public long L
Arrays: An array is a group of like-typed variables that are referred to by a common name. Example: // C# program to demonstrate the Arrays using System; c
C# supports the creation and manipulation of arrays, as a data structure. The index of an array is an integer value that has value in the interval [0, n-1], whe
In C/C++, we can assign a struct (or class in C++ only) variable to another variable of same type. When we assign a struct variable to another, all members of t
Most of the time, pointer and array accesses can be treated as acting the same, the major exceptions being: 1) the sizeof operator o sizeof(array) returns the a
Programmable Array Logic (PAL) is a commonly used programmable logic device (PLD). It has programmable AND array and fixed OR array. Because only the AND array
Programmable Logic Array(PLA) is a fixed architecture logic device with programmable AND gates followed by programmable OR gates. PLA is basically a type of pro