Home

Awesome

HackerRank Data Structures Solutions

problems-solved java python cpp md PRs Welcome cp cp

This repository contains solutions to the Data Structures domain part of HackerRank. The Data Structures Domain Falls under a broader Problem Solving Skill Set in HackerRank which consists of both Data Structures and Algorithms.

The Data Structures Domain is further Divided into the following sub-domains. To Contribute have a look at Contributing.md and happy coding 😀 🐱‍💻.

Sub Domains & Problems (+Solutions) in the Data Structures Domain

⚡ Quick Links: Arrays | Linked Lists | Trees | Balanced Trees | Stacks | Queues | Heap | Disjoint Set | Multiple Choice | Trie | Advanced |

Arrays problems-solved

ProblemDifficulty LevelSolution Link
Arrays - DSEasyJava
2D Arrays - DSEasyJava
Dynamic ArrayEasyJava
Left RotationEasyJava
Sparse ArraysMediumJava
Array ManipulationHardJava

Linked Lists problems-solved

ProblemDifficulty LevelSolution Link
Print the Elements of a Linked ListEasyJava
Insert a Node at the Tail of a Linked ListEasyJava
Insert a Node at the head of a Linked ListEasyJava
Insert a Node at a specific position in a Linked ListEasyJava
Delete a NodeEasyJava
Print in ReverseEasyJava
Reverse a Linked ListEasyJava
Compare two Linked ListsEasyJava
Merge two sorted Linked ListsEasyJava
Get Node ValueEasyJava
Delete Duplicate Value Nodes from a sorted Linked ListEasyJava
Cycle DetectionMediumJava
Find Merge Points of Two ListsEasyJava
Inserting a Node Into a Sorted Double Linked ListEasyJava
Reverse a Doubly Linked ListEasyJava

Trees problems-solved

ProblemDifficulty LevelSolution Link
Tree: Preorder TraversalEasyJava
Tree: Postorder TraversalEasyJava
Tree: Inorder TraversalEasyJava
Tree: Height of Binary TreeEasyJava
Tree: Level Order TraversalEasyJava
Binary Search Tree: InsertionEasyJava
Tree: Huffman DecodingMediumJava
Binary Search Tree: Lowest Common AncestorEasyJava
Swap Nodes [Algo]MediumJava
Is There a Binary Search TreeMediumJava
Tree: Top ViewEasyJava
Kitty's Calculations on a TreeAdvancedC++
Square Ten TreeHardC++
Balanced ForestHardPython
Jenny's SubtreesHard
Tree CoordinatesExpert
Array PairsAdvanced

Balanced Trees problems-solved

ProblemDifficulty LevelSolution Link
Self Balancing TreeMedium
Array and Simple QueriesHard
Median UpdatesHard

Stacks problems-solved

ProblemDifficulty LevelSolution Link
Maximum ElementEasyJava
Balanced BracketsMediumJava
Equal StacksEasyJava
Game of Two StacksMediumJava
Simple Text EditorMediumJava
WaiterMediumJava
Largest RectangleMediumJava Python
Poisonous PlantsHardJava
AND xor ORHard

Queues problems-solved

ProblemDifficulty LevelSolution Link
Queue Using Two StacksMediumJava
Castle on The GridMediumJava
Down to Zero IIMediumJava
Truck TourHardJava
Queries with Fixed LengthHardJava

Heap problems-solved

ProblemDifficulty LevelSolution Link
QHEAP1EasyJava
Jessie and CookiesEasyJava
Find the Running MedianHardJava
Minimum Average Wait TimeHardPython

Disjoint Set problems-solved

ProblemDifficulty LevelSolution Link
Components In A GraphMediumJava
Kundu and TreeHard
Super Maximum Cost QueriesHard
Merging CommunitiesHard

Multiple Choice problems-solved

ProblemDifficulty LevelSolution Link
Data Structures MCQ1Multiple Choice QuestionMarkdown
Data Structures MCQ2Multiple Choice QuestionMarkdown
Data Structures MCQ3Multiple Choice QuestionMarkdown

Trie problems-solved

ProblemDifficulty LevelSolution Link
ContactsMediumJava
No Prefix SetHard

Advanced problems-solved

ProblemDifficulty LevelSolution Link
Kindergarten AdventuresMedium
Mr. X and his ShotsMedium
Cube SummationHard
Direct ConnectionsHard
Subsequence WeightingAdvanced
Jim and the SkyscrapersMedium
Palindromic SubsetsHard
Counting On A TreeExpert
Polynomial DivisionHard
Costly IntervalsHard
The Strange FunctionHard
Self-Driving BusAdvanced
Unique ColorsAdvanced
Fibonacci Numbers TreeExpert
Pair SumsExpert
Functional PalindromesAdvanced
Lazy White FalconHard
Ticket To RideExpert
Heavy Light White FalconHard
Sum of The MaximumsAdvanced
Number Game On A TreeExpert
Heavy Light 2 White FalconHard
Library QueryAdvanced
StarfleetAdvanced
Almost Equal - AdvancedExpert
Almost Sorted IntervalExpert
Burger HappinessHard
Roy and Alpha Beta TreesHard
Coloring TreeHard
Recalling Early Days GP With TreesHard
Swaps and SumsAdvanced
Arithmetic ProgressionsAdvanced
Coolguy And Two SubsequencesAdvanced
White Falcon and TreeHard
Subtrees and PathsAdvanced
TripletsAdvanced
Beautiful SegmentsExpert
DivisibilityExpert
BST MaintenanceAdvanced
Find Maximum Index ProductMedium
Taxicab Driver's ProblemAdvanced
Jaggu Playing With BalloonsAdvanced
Dynamic SummationHard
Two Array ProblemHard
Rooted TreeHard
The Crazy HelixAdvanced
Network AdministrationHard
Easy AdditionExpert
Find The PermutationExpert
Company RetreatAdvanced
Box OperationsExpert
Max TransformExpert
Array and QueriesHard