Posts

Agile Principles

Image
In the previous article, we learned about Agile Manifesto . Here, in this article we are going to note down the principles of agile . Source: Google Principles of Agile: Satisfy Customer through early and continuous delivery. Welcome, change requirement even in late development. Deliver working software frequently [ i.e., couple of weeks to couple of months ] Business people and developers work together daily. Build projects under motivated individuals.[ Give each individual, a required environment, support they need and trust them to get the job done ] Convey information to developer team through face to face conversation. Working software is a primary progress. Promote sustainable development. Developer and Customer should develop constant pace indefinitely. Continuous attention for technical enhances and good design. Simplicity - art of maximising amount of not work done is essential. Best architectures, requirement, design, emerging from self organizing teams. At regular intervals,

Balanced Binary Tree

Image
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the left and right subtrees of  every  node differ in height by no more than 1. Example 1: Input: root = [3,9,20,null,null,15,7] Output: true Example 2: Input: root = [1,2,2,3,3,null,null,4,4] Output: false Example 3: Input: root = [] Output: true   Constraints: The number of nodes in the tree is in the range  [0, 5000] . -10 4  <= Node.val <= 10 4 Solution: /**  * Definition for a binary tree node.  * public class TreeNode {  *     int val;  *     TreeNode left;  *     TreeNode right;  *     TreeNode() {}  *     TreeNode(int val) { this.val = val; }  *     TreeNode(int val, TreeNode left, TreeNode right) {  *         this.val = val;  *         this.left = left;  *         this.right = right;  *     }

Smallest Range II

Given an array   A   of integers, for each integer   A[i]   we need to choose   either  x = -K  or  x = K , and add   x   to   A[i]  (only once) . After this process, we have some array  B . Return the smallest possible difference between the maximum value of  B  and the minimum value of  B . Example 1: Input: A = [1] , K = 0 Output: 0 Explanation : B = [1] Example 2: Input: A = [0,10] , K = 2 Output: 6 Explanation : B = [2,8] Example 3: Input: A = [1,3,6] , K = 3 Output: 3 Explanation : B = [4,6,3] Note: 1 <= A.length <= 10000 0 <= A[i] <= 10000 0 <= K <= 10000 Solution: class Solution {     public int smallestRangeII(int[] A, int K) {         int i, min=0, max=0, min1, min2, max1, max2, length = A.length, diff

Agile Manifesto

Image
In the previous article, we learned about history of Agile . Now, in this article you will find about the Manifesto of Agile  Source: Google Agile Manifesto: Below are the manifesto of Agile., Individuals and Interactions over process and tools Working software over comprehensive documentation Customer Collaboration over contract negotiation Responding to the change over following the plan. Also read: Principles of Agile Related Posts: List of all Leetcode Problems with Solutions and Explanation  Explore more on our blog Agile Contents Like us? Please do share with your friends ..!! Follow us to receive updates instantly. If you have any feedback/suggestions, leave it in a comment section which will be helpful for us to improve.

Agile History

Image
In this chapter, we are going to learn about Agile. Here, we discussed about few points which we will give you a history and evolution of agile. In whole learning most of the articles are written as points or notes, so that anyone can understand and learn easily. Source: Google Agile can be described in many ways. One among those is, Agile is not a specific model/process, it is a mindset. During early 1990's many of the light weight development models evolved to overcome drawbacks from Waterfall Model, Iterative Model etc. These includes Rapid Application Development (RAD), Unified process etc. After few years, around 2001, seventeen software developers together met at resort in Snowbird , Utah to discuss about Lightweight development model . These developers includes: Kent Beck, Dave Thomas, Ward Cunningham, Jeff Sutherland, Steve Mellor, Jon Kern, Brian Marick, Ken Schwaber, Jim Highsmith, Ron Jeffries, Andrew Hunt, James Grenning, Martin Fowler, Arie van Bennekum, Mike Beedle, R

Validate Binary Search Tree

Image
Given the   root   of a binary tree,   determine if it is a valid binary search tree (BST) . A  valid BST  is defined as follows: The left subtree of a node contains only nodes with keys  less than  the node's key. The right subtree of a node contains only nodes with keys  greater than  the node's key. Both the left and right subtrees must also be binary search trees. Example 1: Input: root = [2,1,3] Output: true Example 2: Input: root = [5,1,4,null,null,3,6] Output: false Explanation: The root node's value is 5 but its right child's value is 4.   Constraints: The number of nodes in the tree is in the range  [1, 10 4 ] . -2 31  <= Node.val <= 2 31  - 1 Solution: /**  * Definition for a binary tree node.  * public class TreeNode {  *     int val;  *     TreeNode left;  *     TreeNode right;  *     TreeNode() {}  *     TreeNode(int val) { this.val =