HackerRank Data Structures Solutions
HackerRank is an online platform that offers programmers the ability to test their sills, practice and learn something new. The problem sets on HackerRank are divided in Domains & Tutorials, and the following are the domains & tutorials on HackerRank:
Domains
This repository contains solutions to the Data Structures domain part of HackerRank. My HackerRank profile can be viewed here.
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-domain. All problems in this domain have been mainly solved with the Java programming language, but I am looking for contributors to add solutions in this repository in other languages as well and to that effect anyonne can create a pull request for any problem below in their favorite programming language. See Contributing Guidelines here.
I have also solved other domains on HackerRank that can be viewed at:
| Domain | Solutions Repository Link |
|---|---|
| Algorithms | Solutions Repository |
| Java | Solutions Repository |
| Python | Solutions Repository |
| Interview Preparation Kit | Solutions Repository |
Sub Domains & Problems (+Solutions) in the Data Structures Domain
Quick Links
Arrays π
| Problem | Difficulty Level | Solution Link |
|---|---|---|
| Arrays - DS | Easy | |
| 2D Arrays - DS | Easy | |
| Dynamic Array | Easy | |
| Left Rotation | Easy | |
| Sparse Arrays | Medium | |
| Array Manipulation | Hard |
Linked Lists π
| Problem | Difficulty Level | Solution Link |
|---|---|---|
| Print the Elements of a Linked List | Easy | |
| Insert a Node at the Tail of a Linked List | Easy | |
| Insert a Node at the head of a Linked List | Easy | |
| Insert a Node at a specific position in a Linked List | Easy | |
| Delete a Node | Easy | |
| Print in Reverse | Easy | |
| Reverse a Linked List | Easy | |
| Compare two Linked Lists | Easy | |
| Merge two sorted Linked Lists | Easy | |
| Get Node Value | Easy | |
| Delete Duplicate Value Nodes from a sorted Linked List | Easy | |
| Cycle Detection | Medium | |
| Find Merge Points of Two Lists | Easy | |
| Inserting a Node Into a Sorted Double Linked List | Easy | |
| Reverse a Doubly Linked List | Easy |
Trees π
| Problem | Difficulty Level | Solution Link |
|---|---|---|
| Tree: Preorder Traversal | Easy | |
| Tree: Postorder Traversal | Easy | |
| Tree: Inorder Traversal | Easy | |
| Tree: Height of Binary Tree | Easy | |
| Tree: Level Order Traversal | Easy | |
| Binary Search Tree: Insertion | Easy | |
| Tree: Huffman Decoding | Medium | |
| Binary Search Tree: Lowest Common Ancestor | Easy | |
| Swap Nodes [Algo] | Medium | |
| Is There a Binary Search Tree | Medium | |
| Tree: Top View | Easy | |
| Kitty's Calculations on a Tree | Advanced | |
| Square Ten Tree | Hard | |
| Balanced Forest | Hard | |
| Jenny's Subtrees | Hard | |
| Tree Coordinates | Expert | |
| Array Pairs | Advanced |
Balanced Trees π
| Problem | Difficulty Level | Solution Link |
|---|---|---|
| Self Balancing Tree | Medium | |
| Array and Simple Queries | Hard | |
| Median Updates | Hard |
Stacks π
| Problem | Difficulty Level | Solution Link |
|---|---|---|
| Maximum Element | Easy | |
| Balanced Brackets | Medium | |
| Equal Stacks | Easy | |
| Game of Two Stacks | Medium | |
| Simple Text Editor | Medium | |
| Waiter | Medium | |
| Largest Rectangle | Medium | |
| Poisonous Plants | Hard | |
| AND xor OR | Hard |
Queues π
| Problem | Difficulty Level | Solution Link |
|---|---|---|
| Queue Using Two Stacks | Medium | |
| Castle on The Grid | Medium | |
| Down to Zero II | Medium | |
| Truck Tour | Hard | |
| Queries with Fixed Length | Hard |
Heap π
| Problem | Difficulty Level | Solution Link |
|---|---|---|
| QHEAP1 | Easy | |
| Jessie and Cookies | Easy | |
| Find the Running Median | Hard | |
| Minimum Average Wait Time | Hard |
Disjoint Set π
| Problem | Difficulty Level | Solution Link |
|---|---|---|
| Components In A Graph | Medium | |
| Kundu and Tree | Hard | |
| Super Maximum Cost Queries | Hard | |
| Merging Communities | Hard |
Multiple Choice π
| Problem | Difficulty Level | Solution Link |
|---|---|---|
| Data Structures MCQ1 | Multiple Choice Question | |
| Data Structures MCQ2 | Multiple Choice Question | |
| Data Structures MCQ3 | Multiple Choice Question |
Trie π
| Problem | Difficulty Level | Solution Link |
|---|---|---|
| Contacts | Medium | |
| No Prefix Set | Hard |