Instantly share code, notes, and snippets.

📚
Always Learning !

# NIHAL SINGH nihal-singh

📚
Always Learning !
Last active August 26, 2020 12:39
Coursera Python For Data Science Course
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created August 26, 2020 08:57
Created on Skills Network Labs
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Last active August 26, 2020 12:42
Coursera Python For data Science
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Last active August 25, 2020 18:32
Numpy2D
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created June 24, 2020 18:42
Code Solutions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 class Solution { public int removeDuplicates(int[] nums) { int len = nums.length; // calculate length of the array. if(len == 0 || len == 1)return len; // return length if array has zero or only one element. int lastMem = nums[0]; // stores the element that is not duplicate int count = 1; //return count at last so as to get the unique element count int index = 1;
Created September 21, 2018 13:31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 /* C++ program to find Inorder successor in a BST */ #include using namespace std; struct Node { int data; struct Node *left; struct Node *right; }; //Function to find some data in the tree
Created September 20, 2018 13:32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 /* Deleting a node from Binary search tree */ #include using namespace std; struct Node { int data; struct Node *left; struct Node *right; }; //Function to find minimum in a tree. Node* FindMin(Node* root)
Created September 18, 2018 18:17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 //Pseudo code to check whether a binary tree is Binary Search Tree or not bool checkBST(Node* root,int min,int max){ if(root == NULL)return true; if(root->data > min && root->data < max && checkBST(root->left,min,root->data) && checkBST(root->right,root->data,max)) return true; else return false; } isBST(Node* root){ return checkBST(root, INT_MIN, INT_MAX);
Created September 18, 2018 12:05
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 /* Binary Tree Traversal - Preorder, Inorder, Postorder */ #include using namespace std; struct Node { char data; struct Node *left; struct Node *right; };
Created September 18, 2018 12:03
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 /* Binary tree - Level Order Traversal */ #include #include using namespace std; struct Node { char data; Node *left; Node *right; };