# Category Archives: Data Structures

This category is for logical grouping only. It needn’t to be added directly. Instead, the sub-categories should be added.

## Make the string in AP by changing a character

Given a string S that consists of letters such that their ASCII values follow an Arithmetic Progression. The task is to find the letter and… Read More »

## Maximum profit by buying and selling a stock at most twice | Set 2

Given an array prices[] which denotes the prices of the stocks on different days, the task is to find the maximum profit possible for buying… Read More »

## Convert string to integer without using any in-built functions

Given a string str, the task is to convert the given string into the number without using any inbuilt function. Examples:  Input: str = “985632”… Read More »

## Permutation of Array such that sum of adjacent elements are not divisible by 3

Given an array arr[] of positive integers, the task is to find the permutation of the array such that sum of adjacent elements is not… Read More »

## Maximum sum of values in a given range of an Array for Q queries when shuffling is allowed

Given an array arr[] and K subarrays in the form (Li, Ri), the task is to find the maximum possible value of . It is… Read More »

## Check if ceil of number divided by power of two exist in sorted array

Given a sorted array arr[] and an integer K, the task is to check if there exists a ceil of number K divided by some… Read More »

## Count of unique digits in a given number N

Given a number N, the task is to count the number of unique digits in the given number. Examples: Input: N = 22342 Output: 2 Explanation:The digits… Read More »

## Length of longest subsequence in an Array having all elements as Nude Numbers

Given an array arr[] of N positive integers, the task is to print the length of the longest subsequence of the array such that all… Read More »

## What are the C programming concepts used as Data Structures

Data Types Data-type in simple terms gives us information about the type of data. Example, integer, character, etc. Data-types in C language are declarations for the… Read More »

## Array of Structures vs. Array within a Structure in C/C++

Array within a Structure A structure is a data type in C/C++ that allows a group of related variables to be treated as a single… Read More »

## Maximum score of deleting an element from an Array based on given condition

Given an array arr[], the task is to find the maximum score of deleting an element where each element of the array can be deleted… Read More »

## Check if incoming edges in a vertex of directed graph is equal to vertex itself or not

Given a directed Graph G(V, E) with V vertices and E edges, the task is to check that for all vertices of the given graph,… Read More »

## Check if vertex X lies in subgraph of vertex Y for the given Graph

Given an undirected graph and two vertices X and Y, our task is to check whether the vertex X lies in the subgraph of the… Read More »

## Count of numbers upto N having absolute difference of at most K between any two adjacent digits

Given an integer N, the task is to count the numbers up to N having an absolute difference of at most K between any two… Read More »

## Length of longest subarray whose sum is not divisible by integer K

Given an array arr[] of size N and an integer k, our task is to find the length of longest subarray whose sum of elements… Read More »