Git Product home page Git Product logo

hackerrank-solutions's Introduction

HackerRank-Solutions

This repository consists of all the HackerRank projects or challenges completed by me and contributed by others. (Updating regularly)

forthebadge forthebadge

About HackerRank

HackerRank is a technology company that focuses on competitive programming challenges for both consumers and businesses, where developers compete by trying to program according to provided specifications. Visit HackerRank here.

See my HackerRank profile here: https://www.hackerrank.com/kvaibhav01?hr_r=1

hackerrank-solutions's People

Contributors

21rachitshukla avatar aayushbhan avatar carolvalenca avatar ishaan28malik avatar kvaibhav01 avatar lielfr avatar michaelmdev avatar pradyuman7 avatar priyamm avatar samuelribeiroc avatar subhampramanik avatar voldemortuk avatar yashika25 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hackerrank-solutions's Issues

Commit new solution files for Data Structures

Visit HackerRank's Data Structures website, visit the subdomains and commit new problem solutions at the repo's Data Structures folder.

Rules:

  1. Solutions must be correct (obviously), I will review them before merging.
  2. The solution's directory path must be according to the subdomain HackerRank provides for Data Structures. Example: /Data Structures/Subdomain name/Solution.java or /Data Structures/Subdomain name/RelevantFileName.java
  3. Code can be done in any preferred language but Java and JavaScript are recommended. Someone who provides the solution in Kotlin/PHP (or any other language except recommended ones) will be considered later.
  4. Code should be formatted properly. Unformatted code will be disregarded.
  5. The solution you submit should be of your own.

Solution for BST related question

Your device hardware:

Issue details:
Given the root node of a binary tree, can you determine if it's also a binary search tree?
Complete the function which has parameter: a pointer to the root of a binary tree. It must return a boolean denoting whether or not the binary tree is a binary search tree. You may have to write one or more helper functions to complete this challenge.

boolean checkBST(Node root) {
return checkBSTUtil(root, null, null);
}
private boolean checkBSTUtil(Node root, Node min, Node max){
if(root == null){
return true;
}
if(min != null && min.data >= root.data){
return false;
}
if(max != null && root.data >= max.data){
return false;
}
return checkBSTUtil(root.left, min, root) && checkBSTUtil(root.right, root, max);
}

Log (optional):

Add problem description

Currently, the repo only contains solution's problems but are not descriptive. You can add a README.md file describing the problem or solution (if possible) in detail.

Add more solutions

You can add more solutions to any new problems. Make sure the solution(s) is/are in Java language.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.