Given two strings, A and B, output true if B is a substring of A and false otherwise. The first line contains the number of test cases T. This is followed by T lines each consisting of pairs of binary strings A and B.
Stacks and queues are data structures that store elements of a specific data type. They have various operations (methods/functions) to input, output and manage the data.
Stack implements a last-in, first-out (LIFO) policy on its elements.
The Heap data structure is an array that can be viewed as a complete Binary Tree. Each node in the tree corresponds to an element of the array A[].
In this post we will learn about, how to build min/max Heaps using STL.
A vector is a data structure for maintaining a set of elements having a specific data type. Vectors can be considered as arrays having dynamic size. Just like arrays, vectors also store its elements in a contiguous storage locations.
In the last post we discussed about C++ Standard Template Library (STL) Linked List. In this post we will learn about STL Priority queue and using it as Max/Min Heap. A priority queue is a data structure for maintaining a set of elements having an associated value.
The C++ Standard Template Library (STL) is a powerful library of C++ template classes that provide general-purpose classes and functions. It has implementations of many popular and commonly used algorithms and data structures like vectors, linked-lists etc.