diff --git a/ClassificationofDataStructure.jpg b/ClassificationofDataStructure.jpg
new file mode 100644
index 0000000..d27612d
Binary files /dev/null and b/ClassificationofDataStructure.jpg differ
diff --git a/CodingInterviews/.project b/CodingInterviews/.project
index 64db0a7..e68bc75 100644
--- a/CodingInterviews/.project
+++ b/CodingInterviews/.project
@@ -14,4 +14,15 @@
org.eclipse.jdt.core.javanature
+
+
+ 1671624664256
+
+ 30
+
+ org.eclipse.core.resources.regexFilterMatcher
+ node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
+
+
+
diff --git a/CodingInterviews/bin/com/bst/BST.class b/CodingInterviews/bin/com/bst/BST.class
new file mode 100644
index 0000000..a412812
Binary files /dev/null and b/CodingInterviews/bin/com/bst/BST.class differ
diff --git a/CodingInterviews/bin/com/bst/Node.class b/CodingInterviews/bin/com/bst/Node.class
new file mode 100644
index 0000000..ee1273c
Binary files /dev/null and b/CodingInterviews/bin/com/bst/Node.class differ
diff --git a/CodingInterviews/bin/com/linkedList/LinkedListManager.class b/CodingInterviews/bin/com/linkedList/LinkedListManager.class
new file mode 100644
index 0000000..f05dfdc
Binary files /dev/null and b/CodingInterviews/bin/com/linkedList/LinkedListManager.class differ
diff --git a/CodingInterviews/bin/com/linkedList/LinkedListU.class b/CodingInterviews/bin/com/linkedList/LinkedListU.class
new file mode 100644
index 0000000..6761f4f
Binary files /dev/null and b/CodingInterviews/bin/com/linkedList/LinkedListU.class differ
diff --git a/CodingInterviews/bin/com/linkedList/ListNode.class b/CodingInterviews/bin/com/linkedList/ListNode.class
new file mode 100644
index 0000000..ae5c651
Binary files /dev/null and b/CodingInterviews/bin/com/linkedList/ListNode.class differ
diff --git a/CodingInterviews/bin/com/problem1/Cell.class b/CodingInterviews/bin/com/problem1/Cell.class
new file mode 100644
index 0000000..b370c1c
Binary files /dev/null and b/CodingInterviews/bin/com/problem1/Cell.class differ
diff --git a/CodingInterviews/bin/com/problem1/ShortPath.class b/CodingInterviews/bin/com/problem1/ShortPath.class
new file mode 100644
index 0000000..9ae917b
Binary files /dev/null and b/CodingInterviews/bin/com/problem1/ShortPath.class differ
diff --git a/CodingInterviews/bin/com/problem11/TreeNetwork.class b/CodingInterviews/bin/com/problem11/TreeNetwork.class
new file mode 100644
index 0000000..7359bf9
Binary files /dev/null and b/CodingInterviews/bin/com/problem11/TreeNetwork.class differ
diff --git a/CodingInterviews/bin/com/problem12/Mirror.class b/CodingInterviews/bin/com/problem12/Mirror.class
new file mode 100644
index 0000000..48b92cd
Binary files /dev/null and b/CodingInterviews/bin/com/problem12/Mirror.class differ
diff --git a/CodingInterviews/bin/com/problem13/GraphLevel.class b/CodingInterviews/bin/com/problem13/GraphLevel.class
new file mode 100644
index 0000000..03a82d0
Binary files /dev/null and b/CodingInterviews/bin/com/problem13/GraphLevel.class differ
diff --git a/CodingInterviews/bin/com/problem14/FirendCircle.class b/CodingInterviews/bin/com/problem14/FirendCircle.class
new file mode 100644
index 0000000..d104206
Binary files /dev/null and b/CodingInterviews/bin/com/problem14/FirendCircle.class differ
diff --git a/CodingInterviews/bin/com/problem15/WordDistance.class b/CodingInterviews/bin/com/problem15/WordDistance.class
new file mode 100644
index 0000000..b9c7a2d
Binary files /dev/null and b/CodingInterviews/bin/com/problem15/WordDistance.class differ
diff --git a/CodingInterviews/bin/com/problem16/WordSimilar.class b/CodingInterviews/bin/com/problem16/WordSimilar.class
new file mode 100644
index 0000000..689f065
Binary files /dev/null and b/CodingInterviews/bin/com/problem16/WordSimilar.class differ
diff --git a/CodingInterviews/bin/com/problem17/Option.class b/CodingInterviews/bin/com/problem17/Option.class
new file mode 100644
index 0000000..aff97a0
Binary files /dev/null and b/CodingInterviews/bin/com/problem17/Option.class differ
diff --git a/CodingInterviews/bin/com/problem17/WordBreak.class b/CodingInterviews/bin/com/problem17/WordBreak.class
new file mode 100644
index 0000000..086f939
Binary files /dev/null and b/CodingInterviews/bin/com/problem17/WordBreak.class differ
diff --git a/CodingInterviews/bin/com/problem18/SprialMatrix.class b/CodingInterviews/bin/com/problem18/SprialMatrix.class
new file mode 100644
index 0000000..9f0168c
Binary files /dev/null and b/CodingInterviews/bin/com/problem18/SprialMatrix.class differ
diff --git a/CodingInterviews/bin/com/problem2/GCell.class b/CodingInterviews/bin/com/problem2/GCell.class
new file mode 100644
index 0000000..45b2e89
Binary files /dev/null and b/CodingInterviews/bin/com/problem2/GCell.class differ
diff --git a/CodingInterviews/bin/com/problem2/TripPlaner.class b/CodingInterviews/bin/com/problem2/TripPlaner.class
new file mode 100644
index 0000000..1ebec7b
Binary files /dev/null and b/CodingInterviews/bin/com/problem2/TripPlaner.class differ
diff --git a/CodingInterviews/bin/com/problem20/TopMoviesInStream.class b/CodingInterviews/bin/com/problem20/TopMoviesInStream.class
new file mode 100644
index 0000000..a456934
Binary files /dev/null and b/CodingInterviews/bin/com/problem20/TopMoviesInStream.class differ
diff --git a/CodingInterviews/bin/com/problem21/MerageLinkedList.class b/CodingInterviews/bin/com/problem21/MerageLinkedList.class
new file mode 100644
index 0000000..c291be0
Binary files /dev/null and b/CodingInterviews/bin/com/problem21/MerageLinkedList.class differ
diff --git a/CodingInterviews/bin/com/problem3/FindPathBetweenTwoNodes.class b/CodingInterviews/bin/com/problem3/FindPathBetweenTwoNodes.class
new file mode 100644
index 0000000..ee7f8ef
Binary files /dev/null and b/CodingInterviews/bin/com/problem3/FindPathBetweenTwoNodes.class differ
diff --git a/CodingInterviews/bin/com/problem4/SimilarTree.class b/CodingInterviews/bin/com/problem4/SimilarTree.class
new file mode 100644
index 0000000..415202b
Binary files /dev/null and b/CodingInterviews/bin/com/problem4/SimilarTree.class differ
diff --git a/CodingInterviews/bin/com/problem5/LCSOnes.class b/CodingInterviews/bin/com/problem5/LCSOnes.class
new file mode 100644
index 0000000..ad3fd0f
Binary files /dev/null and b/CodingInterviews/bin/com/problem5/LCSOnes.class differ
diff --git a/CodingInterviews/bin/com/problem6/BinarySearch.class b/CodingInterviews/bin/com/problem6/BinarySearch.class
new file mode 100644
index 0000000..20ba660
Binary files /dev/null and b/CodingInterviews/bin/com/problem6/BinarySearch.class differ
diff --git a/CodingInterviews/bin/com/problem7/LCS.class b/CodingInterviews/bin/com/problem7/LCS.class
new file mode 100644
index 0000000..50b0843
Binary files /dev/null and b/CodingInterviews/bin/com/problem7/LCS.class differ
diff --git a/CodingInterviews/bin/com/problem8/Stair.class b/CodingInterviews/bin/com/problem8/Stair.class
new file mode 100644
index 0000000..173f1bf
Binary files /dev/null and b/CodingInterviews/bin/com/problem8/Stair.class differ
diff --git a/CodingInterviews/bin/com/problem8/StairCaseDemo.class b/CodingInterviews/bin/com/problem8/StairCaseDemo.class
new file mode 100644
index 0000000..80b5c81
Binary files /dev/null and b/CodingInterviews/bin/com/problem8/StairCaseDemo.class differ
diff --git a/CodingInterviews/bin/com/problem9/Parentheses.class b/CodingInterviews/bin/com/problem9/Parentheses.class
new file mode 100644
index 0000000..42a11c9
Binary files /dev/null and b/CodingInterviews/bin/com/problem9/Parentheses.class differ
diff --git a/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/GFG.cs b/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/GFG.cs
new file mode 100644
index 0000000..70613fc
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/GFG.cs
@@ -0,0 +1,89 @@
+// C# program to demonstrate searching operation
+// in binary search tree without recursion
+using System;
+
+class GFG {
+
+ public class Node {
+ public int data;
+ public Node left, right;
+ };
+
+ // Function to check the given key exist or not
+ static bool iterativeSearch(Node root, int key)
+ {
+ // Traverse until root reaches to dead end
+ while (root != null) {
+ // pass right subtree as new tree
+ if (key > root.data)
+ root = root.right;
+
+ // pass left subtree as new tree
+ else if (key < root.data)
+ root = root.left;
+ else
+ return true; // if the key is found return 1
+ }
+ return false;
+ }
+
+ // A utility function to create a new BST Node
+ static Node newNode(int item)
+ {
+ Node temp = new Node();
+ temp.data = item;
+ temp.left = temp.right = null;
+ return temp;
+ }
+
+ /* A utility function to insert a new Node with
+given key in BST */
+ static Node insert(Node Node, int data)
+ {
+ /* If the tree is empty, return a new Node */
+ if (Node == null)
+ return newNode(data);
+
+ /* Otherwise, recur down the tree */
+ if (data < Node.data)
+ Node.left = insert(Node.left, data);
+ else if (data > Node.data)
+ Node.right = insert(Node.right, data);
+
+ /* return the (unchanged) Node pointer */
+ return Node;
+ }
+
+ // Driver code
+ public static void Main(String[] args)
+ {
+ /* Let us create following BST
+ 50
+ / \
+ 30 70
+ / \ / \
+ 20 40 60 80 */
+ Node root = null;
+ root = insert(root, 50);
+ insert(root, 30);
+ insert(root, 20);
+ insert(root, 40);
+ insert(root, 70);
+ insert(root, 60);
+ insert(root, 80);
+ if (iterativeSearch(root, 15))
+ Console.WriteLine("YES");
+ else
+ Console.WriteLine("NO");
+ }
+}
+
+// This code has been contributed by 29AjayKumar
+
+
+/*
+Output
+No
+Time Complexity: O(h), here h is the height of the BST.
+Auxiliary Space: O(1), as constant extra space is used.
+*/
\ No newline at end of file
diff --git a/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/GFG.java b/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/GFG.java
new file mode 100644
index 0000000..6d6d408
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/GFG.java
@@ -0,0 +1,90 @@
+
+import java.util.*;
+
+// Java program to demonstrate searching operation
+// in binary search tree without recursion
+
+class GFG {
+
+ static class Node {
+ int data;
+ Node left, right;
+ };
+
+ // Function to check the given key exist or not
+ static boolean iterativeSearch(Node root, int key)
+ {
+ // Traverse until root reaches to dead end
+ while (root != null) {
+ // pass right subtree as new tree
+ if (key > root.data)
+ root = root.right;
+
+ // pass left subtree as new tree
+ else if (key < root.data)
+ root = root.left;
+ else
+ return true; // if the key is found return 1
+ }
+ return false;
+ }
+
+ // A utility function to create a new BST Node
+ static Node newNode(int item)
+ {
+ Node temp = new Node();
+ temp.data = item;
+ temp.left = temp.right = null;
+ return temp;
+ }
+
+ /* A utility function to insert a new Node with
+given key in BST */
+ static Node insert(Node Node, int data)
+ {
+ /* If the tree is empty, return a new Node */
+ if (Node == null)
+ return newNode(data);
+
+ /* Otherwise, recur down the tree */
+ if (data < Node.data)
+ Node.left = insert(Node.left, data);
+ else if (data > Node.data)
+ Node.right = insert(Node.right, data);
+
+ /* return the (unchanged) Node pointer */
+ return Node;
+ }
+
+ // Driver code
+ public static void main(String args[])
+ {
+ /* Let us create following BST
+ 50
+ / \
+ 30 70
+ / \ / \
+ 20 40 60 80 */
+ Node root = null;
+ root = insert(root, 50);
+ insert(root, 30);
+ insert(root, 20);
+ insert(root, 40);
+ insert(root, 70);
+ insert(root, 60);
+ insert(root, 80);
+ if (iterativeSearch(root, 15))
+ System.out.println("YES");
+ else
+ System.out.println("NO");
+ }
+}
+
+// This code is contributed by Arnab Kundu
+
+/*
+Output
+No
+Time Complexity: O(h), here h is the height of the BST.
+Auxiliary Space: O(1), as constant extra space is used.
+*/
\ No newline at end of file
diff --git a/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/Node.cpp b/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/Node.cpp
new file mode 100644
index 0000000..a73e523
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/Node.cpp
@@ -0,0 +1,86 @@
+// C++ program to demonstrate searching operation
+// in binary search tree without recursion
+#include
+using namespace std;
+
+struct Node {
+ int data;
+ struct Node *left, *right;
+};
+
+// Function to check the given key exist or not
+bool iterativeSearch(struct Node* root, int key)
+{
+ // Traverse until root reaches to dead end
+ while (root != NULL) {
+ // pass right subtree as new tree
+ if (key > root->data)
+ root = root->right;
+
+ // pass left subtree as new tree
+ else if (key < root->data)
+ root = root->left;
+ else
+ return true; // if the key is found return 1
+ }
+ return false;
+}
+
+// A utility function to create a new BST Node
+struct Node* newNode(int item)
+{
+ struct Node* temp = new Node;
+ temp->data = item;
+ temp->left = temp->right = NULL;
+ return temp;
+}
+
+/* A utility function to insert a new Node with
+given key in BST */
+struct Node* insert(struct Node* Node, int data)
+{
+ /* If the tree is empty, return a new Node */
+ if (Node == NULL)
+ return newNode(data);
+
+ /* Otherwise, recur down the tree */
+ if (data < Node->data)
+ Node->left = insert(Node->left, data);
+ else if (data > Node->data)
+ Node->right = insert(Node->right, data);
+
+ /* return the (unchanged) Node pointer */
+ return Node;
+}
+
+// Driver Program to test above functions
+int main()
+{
+ /* Let us create following BST
+ 50
+ / \
+ 30 70
+ / \ / \
+ 20 40 60 80 */
+ struct Node* root = NULL;
+ root = insert(root, 50);
+ insert(root, 30);
+ insert(root, 20);
+ insert(root, 40);
+ insert(root, 70);
+ insert(root, 60);
+ insert(root, 80);
+ if (iterativeSearch(root, 15))
+ cout << "Yes";
+ else
+ cout << "No";
+ return 0;
+}
+
+
+/*
+Output
+No
+Time Complexity: O(h), here h is the height of the BST.
+Auxiliary Space: O(1), as constant extra space is used.
+*/
\ No newline at end of file
diff --git a/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/Node.js b/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/Node.js
new file mode 100644
index 0000000..a5b9187
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/Node.js
@@ -0,0 +1,88 @@
+// JavaScript program to
+// demonstrate searching operation
+// in binary search tree without recursion
+
+class Node {
+ constructor() {
+ this.data = 0;
+ this.left = null;
+ this.right = null;
+ }
+}
+
+ // Function to check the given key exist or not
+ function iterativeSearch(root , key)
+ {
+ // Traverse until root reaches to dead end
+ while (root != null) {
+ // pass right subtree as new tree
+ if (key > root.data)
+ root = root.right;
+
+ // pass left subtree as new tree
+ else if (key < root.data)
+ root = root.left;
+ else
+ // if the key is found return 1
+ return true;
+ }
+ return false;
+ }
+
+ // A utility function to create a new BST Node
+ function newNode(item)
+ {
+ var temp = new Node();
+ temp.data = item;
+ temp.left = temp.right = null;
+ return temp;
+ }
+
+ /* A utility function to insert a new Node with
+given key in BST */
+ function insert(Node , data)
+ {
+ /* If the tree is empty, return a new Node */
+ if (Node== null)
+ return newNode(data);
+
+ /* Otherwise, recur down the tree */
+ if (data < Node.data)
+ Node.left = insert(Node.left, data);
+ else if (data > Node.data)
+ Node.right = insert(Node.right, data);
+
+ /* return the (unchanged) Node pointer */
+ return Node;
+ }
+
+ // Driver code
+
+ /* Let us create following BST
+ 50
+ / \
+ 30 70
+ / \ / \
+ 20 40 60 80 */
+ var root = null;
+ root = insert(root, 50);
+ insert(root, 30);
+ insert(root, 20);
+ insert(root, 40);
+ insert(root, 70);
+ insert(root, 60);
+ insert(root, 80);
+ if (iterativeSearch(root, 15))
+ document.write("YES");
+ else
+ document.write("NO");
+
+// This code is contributed by todaysgaurav
+
+
+/*
+Output
+No
+Time Complexity: O(h), here h is the height of the BST.
+Auxiliary Space: O(1), as constant extra space is used.
+*/
\ No newline at end of file
diff --git a/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/newNode.py b/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/newNode.py
new file mode 100644
index 0000000..19f709a
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/search/IterativeSearchingInBinarySearchTree/newNode.py
@@ -0,0 +1,77 @@
+# Python program to demonstrate searching operation
+# in binary search tree without recursion
+class newNode:
+
+ # Constructor to create a new node
+ def __init__(self, data):
+ self.data = data
+ self.left = None
+ self.right = None
+
+# Function to check the given
+# key exist or not
+def iterativeSearch(root, key):
+
+ # Traverse until root reaches
+ # to dead end
+ while root != None:
+
+ # pass right subtree as new tree
+ if key > root.data:
+ root = root.right
+
+ # pass left subtree as new tree
+ elif key < root.data:
+ root = root.left
+ else:
+ return True # if the key is found return 1
+ return False
+
+# A utility function to insert a
+# new Node with given key in BST
+def insert(Node, data):
+
+ # If the tree is empty, return
+ # a new Node
+ if Node == None:
+ return newNode(data)
+
+ # Otherwise, recur down the tree
+ if data < Node.data:
+ Node.left = insert(Node.left, data)
+ elif data > Node.data:
+ Node.right = insert(Node.right, data)
+
+ # return the (unchanged) Node pointer
+ return Node
+
+# Driver Code
+if __name__ == '__main__':
+
+ # Let us create following BST
+ # 50
+ # 30 70
+ # / \ / \
+ # 20 40 60 80
+ root = None
+ root = insert(root, 50)
+ insert(root, 30)
+ insert(root, 20)
+ insert(root, 40)
+ insert(root, 70)
+ insert(root, 60)
+ insert(root, 80)
+ if iterativeSearch(root, 15):
+ print("Yes")
+ else:
+ print("No")
+
+# This code is contributed by PranchalK
+
+
+"""
+Output
+No
+Time Complexity: O(h), here h is the height of the BST.
+Auxiliary Space: O(1), as constant extra space is used.
+"""
\ No newline at end of file
diff --git a/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.cs b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.cs
new file mode 100644
index 0000000..7be3ab0
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.cs
@@ -0,0 +1,13 @@
+// Class containing left and right child
+// of current node and key value
+
+class Node {
+ int key;
+ Node left, right;
+
+ public Node(int item)
+ {
+ key = item;
+ left = right = null;
+ }
+}
diff --git a/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.java b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.java
new file mode 100644
index 0000000..2af7a3f
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.java
@@ -0,0 +1,12 @@
+// Class containing left and right child
+// of current node and key value
+class Node {
+ int key;
+ Node left, right;
+
+ public Node(int item)
+ {
+ key = item;
+ left = right = null;
+ }
+}
diff --git a/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.js b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.js
new file mode 100644
index 0000000..b1d5627
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.js
@@ -0,0 +1,15 @@
+
+/* Class containing left and right child of current
+node and key value*/
+
+class Node
+{
+ constructor(item)
+ {
+ this.key = item;
+ this.left = this.right = null;
+ }
+}
+
+// This code is contributed by umadevi9616
+
diff --git a/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.py b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.py
new file mode 100644
index 0000000..9327a85
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/Node.py
@@ -0,0 +1,8 @@
+# A Python class that represents
+# an individual node in a Binary Tree
+
+class Node:
+ def __init__(self, key):
+ self.left = None
+ self.right = None
+ self.val = key
diff --git a/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/node.c b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/node.c
new file mode 100644
index 0000000..1eceb40
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/node.c
@@ -0,0 +1,7 @@
+// Structure of each node of the tree
+
+struct node {
+ int data;
+ struct node* left;
+ struct node* right;
+};
diff --git a/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/node.cpp b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/node.cpp
new file mode 100644
index 0000000..dabc738
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/ExampleOfATreeNode/node.cpp
@@ -0,0 +1,18 @@
+// Use any below method to implement Nodes of tree
+
+// Method 1: Using "struct" to make
+// user-define data type
+struct node {
+ int data;
+ struct node* left;
+ struct node* right;
+};
+
+// Method 2: Using "class" to make
+// user-define data type
+class Node {
+public:
+ int data;
+ Node* left;
+ Node* right;
+};
diff --git a/DataStructureAndAlgorithms/src/com/tree/README.md b/DataStructureAndAlgorithms/src/com/tree/README.md
new file mode 100644
index 0000000..5e04190
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/README.md
@@ -0,0 +1,155 @@
+# Introduction to Binary Tree – Data Structure and Algorithm Tutorials
+
+A tree is a popular data structure that is non-linear in nature. Unlike other data structures like an array, stack, queue, and linked list which are linear in nature, a tree represents a hierarchical structure. The ordering information of a tree is not important. A tree contains nodes and 2 pointers. These two pointers are the left child and the right child of the parent node. Let us understand the terms of tree in detail.
+
+- Root: The root of a tree is the topmost node of the tree that has no parent node. There is only one root node in every tree.
+
+- Parent Node: The node which is a predecessor of a node is called the parent node of that node.
+
+- Child Node: The node which is the immediate successor of a node is called the child node of that node.
+
+- Sibling: Children of the same parent node are called siblings.
+
+- Edge: Edge acts as a link between the parent node and the child node.
+
+- Leaf: A node that has no child is known as the leaf node. It is the last node of the tree. There can be multiple leaf nodes in a tree.
+
+- Subtree: The subtree of a node is the tree considering that particular node as the root node.
+
+- Depth: The depth of the node is the distance from the root node to that particular node.
+
+- Height: The height of the node is the distance from that node to the deepest node of that subtree.
+
+- Height of tree: The Height of the tree is the maximum height of any node. This is the same as the height of the root node.
+
+- Level: A level is the number of parent nodes corresponding to a given node of the tree.
+
+- Degree of node: The degree of a node is the number of its children.
+
+- NULL: The number of NULL nodes in a binary tree is (N+1), where N is the number of nodes in a binary tree.
+
+
+
+
+## Why to use Tree Data Structure?
+
+1. One reason to use trees might be because you want to store information that naturally forms a hierarchy. For example, the file system on a computer:
+
+
+
+2. Trees (with some ordering e.g., BST) provide moderate access/search (quicker than Linked List and slower than arrays).
+
+3. Trees provide moderate insertion/deletion (quicker than Arrays and slower than Unordered Linked Lists).
+
+4. Like Linked Lists and unlike Arrays, Trees don’t have an upper limit on the number of nodes as nodes are linked using pointers.
+
+
+## The main applications of tree data structure:
+
+1. Manipulate hierarchical data.
+
+2. Make information easy to search (see tree traversal).
+
+3. Manipulate sorted lists of data.
+
+4. As a workflow for compositing digital images for visual effects.
+
+5. Router algorithms
+
+6. Form of multi-stage decision-making (see business chess).
+
+
+## Binary Tree Representation
+
+A binary tree is a tree data structure composed of nodes, each of which has at most, two children, referred to as left and right nodes and the tree begins from root node.
+
+
+
+A Binary tree is represented by a pointer to the topmost node (commonly known as the “root”) of the tree. If the tree is empty, then the value of the root is NULL. Each node of a Binary Tree contains the following parts:
+
+1. Data
+
+2. Pointer to left child
+
+3. Pointer to right child
+
+## Basic Operation On Binary Tree:
+
+- Inserting an element.
+
+- Removing an element.
+
+- Searching for an element.
+
+- Traversing the tree.
+
+## Auxiliary Operation On Binary Tree:
+
+- Finding the height of the tree
+
+- Find the level of a node of the tree
+
+- Finding the size of the entire tree.
+
+## Applications of Binary Tree:
+
+- In compilers, Expression Trees are used which is an application of binary trees.
+
+- Huffman coding trees are used in data compression algorithms.
+
+- Priority Queue is another application of binary tree that is used for searching maximum or minimum in O(1) time complexity.
+
+- Represent hierarchical data.
+
+- used in editing software like Microsoft Excel and spreadsheets.
+
+- useful for indexing segmented at the database is useful in storing cache in the system,
+
+- syntax trees are used for most famous compilers for programming like GCC, and AOCL to perform arithmetic operations.
+
+- for implementing priority queues.
+
+- used to find elements in less time (binary search tree)
+
+- used to enable fast memory allocation in computers.
+
+- to perform encoding and decoding operations.
+
+
+## Binary Tree Traversals:
+
+Tree Traversal algorithms can be classified broadly into two categories:
+
+- Depth-First Search (DFS) Algorithms
+
+- Breadth-First Search (BFS) Algorithms
+
+
+## Tree Traversal using Depth-First Search (DFS) algorithm can be further classified into three categories:
+
+- Preorder Traversal (current-left-right: Visit the current node before visiting any nodes inside the left or right subtrees. Here, the traversal is root – left child – right child. It means that the root node is traversed first then its left child and finally the right child.
+
+- Inorder Traversal (left-current-right): Visit the current node after visiting all nodes inside the left subtree but before visiting any node within the right subtree. Here, the traversal is left child – root – right child. It means that the left child is traversed first then its root node and finally the right child.
+
+- Postorder Traversal (left-right-current): Visit the current node after visiting all the nodes of the left and right subtrees. Here, the traversal is left child – right child – root. It means that the left child has traversed first then the right child and finally its root node.
+
+
+## Tree Traversal using Breadth-First Search (BFS) algorithm can be further classified into one category:
+
+- Level Order Traversal: Visit nodes level-by-level and left-to-right fashion at the same level. Here, the traversal is level-wise. It means that the most left child has traversed first and then the other children of the same level from left to right have traversed.
+
+
+
+Pre-order Traversal of the above tree: 1-2-4-5-3-6-7
+In-order Traversal of the above tree: 4-2-5-1-6-3-7
+Post-order Traversal of the above tree: 4-5-2-6-7-3-1
+Level-order Traversal of the above tree: 1-2-3-4-5-6-7
+
+## Implementation of Binary Tree:
+
+Let us create a simple tree with 4 nodes. The created tree would be as follows.
+
+
+
+Summary: Tree is a hierarchical data structure. Main uses of trees include maintaining hierarchical data, providing moderate access and insert/delete operations. Binary trees are special cases of tree where every node has at most two children.
+
diff --git a/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.cs b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.cs
new file mode 100644
index 0000000..b25b596
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.cs
@@ -0,0 +1,57 @@
+// A C# program to introduce Binary Tree
+using System;
+// Class containing left and right child
+// of current node and key value
+public class Node {
+ public int key;
+ public Node left, right;
+ public Node(int item)
+ {
+ key = item;
+ left = right = null;
+ }
+}
+
+public class BinaryTree {
+
+ // Root of Binary Tree
+ Node root;
+ // Constructors
+ BinaryTree(int key) { root = new Node(key); }
+
+ BinaryTree() { root = null; }
+
+ // Driver Code
+ public static void Main(String[] args)
+
+ {
+ BinaryTree tree = new BinaryTree();
+ // Create root
+ tree.root = new Node(1);
+ /* Following is the tree after above statement
+ 1
+ / \
+ null null */
+ tree.root.left = new Node(2);
+ tree.root.right = new Node(3);
+ /* 2 and 3 become left and right children of 1
+ 1
+ / \
+ 2 3
+ / \ / \
+ null null null null */
+
+ tree.root.left.left = new Node(4);
+ /* 4 becomes left child of 2
+ 1
+ / \
+ 2 3
+ / \ / \
+ 4 null null null
+ / \
+ null null
+*/
+ }
+}
+
+// This code is contributed by PrinciRaj1992
diff --git a/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.java b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.java
new file mode 100644
index 0000000..7994b61
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.java
@@ -0,0 +1,52 @@
+// Class containing left and right child
+// of current node and key value
+class Node {
+
+ int key;
+
+ Node left, right;
+public Node(int item)
+ {
+ key = item;
+ left = right = null;
+ }
+}
+
+// A Java program to introduce Binary Tree
+
+class BinaryTree {
+ // Root of Binary Tree
+ Node root;
+ // Constructors
+ BinaryTree(int key) { root = new Node(key); }
+ BinaryTree() { root = null; }
+ public static void main(String[] args)
+ {
+ BinaryTree tree = new BinaryTree();
+ // create root
+ tree.root = new Node(1);
+ /* following is the tree after above statement
+ 1
+ / \
+ null null */
+
+ tree.root.left = new Node(2);
+ tree.root.right = new Node(3);
+ /* 2 and 3 become left and right children of 1
+ 1
+ / \
+ 2 3
+ / \ / \
+null null null null */
+ tree.root.left.left = new Node(4);
+ /* 4 becomes left child of 2
+ 1
+ / \
+ 2 3
+ / \ / \
+4 null null null
+ / \
+null null
+ */
+ }
+}
diff --git a/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.js b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.js
new file mode 100644
index 0000000..db586a8
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.js
@@ -0,0 +1,51 @@
+
+
+/* Class containing left and right child of current
+
+node and key value*/
+class Node {
+
+constructor(val) {
+this.key = val;
+this.left = null;
+this.right = null;
+}
+
+}
+
+// A javascript program to introduce Binary Tree
+// Root of Binary Tree
+
+var root = null;
+
+/*create root*/
+
+root = new Node(1);
+
+/* following is the tree after above statement
+1
+/ \
+null null */
+
+root.left = new Node(2);
+
+root.right = new Node(3);
+
+/* 2 and 3 become left and right children of 1
+1
+/ \
+2 3
+/ \ / \
+null null null null */
+
+root.left.left = new Node(4);
+
+/* 4 becomes left child of 2
+1
+/ \
+2 3
+/ \ / \
+4 null null null
+/ \
+null null
+*/
diff --git a/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.py b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.py
new file mode 100644
index 0000000..d0fd311
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/Node.py
@@ -0,0 +1,37 @@
+# Python program to introduce Binary Tree
+# A class that represents an individual node
+# in a Binary Tree
+
+
+class Node:
+ def __init__(self, key):
+ self.left = None
+ self.right = None
+ self.val = key
+
+if __name__ == '__main__':
+ # Create root
+ root = Node(1)
+ ''' following is the tree after above statement
+ 1
+ / \
+ None None'''
+root.left = Node(2)
+root.right = Node(3)
+
+''' 2 and 3 become left and right children of 1
+1
+/ \
+2 3
+/ \ / \
+None None None None'''
+
+root.left.left = Node(4)
+'''4 becomes left child of 2
+1
+/ \
+2 3
+/ \ / \
+4 None None None
+/ \
+None None'''
diff --git a/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/node.c b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/node.c
new file mode 100644
index 0000000..3f907d1
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/node.c
@@ -0,0 +1,64 @@
+#include
+#include
+
+struct node {
+ int data;
+ struct node* left;
+ struct node* right;
+};
+
+/* newNode() allocates a new node
+with the given data and NULL left
+and right pointers. */
+
+struct node* newNode(int data)
+{
+ // Allocate memory for new node
+ struct node* node
+ = (struct node*)malloc(sizeof(struct node));
+
+ // Assign data to this node
+ node->data = data;
+
+ // Initialize left and
+ // right children as NULL
+ node->left = NULL;
+ node->right = NULL;
+ return (node);
+}
+
+int main()
+{
+ /*create root*/
+ struct node* root = newNode(1);
+
+ /* following is the tree after above statement
+ 1
+ / \
+ NULL NULL
+ */
+ root->left = newNode(2);
+ root->right = newNode(3);
+
+ /* 2 and 3 become left and right children of 1
+ 1
+ / \
+ 2 3
+ / \ / \
+ NULL NULL NULL NULL
+ */
+
+ root->left->left = newNode(4);
+
+ /* 4 becomes left child of 2
+ 1
+ / \
+2 3
+/ \ / \
+4 NULL NULL NULL
+/ \
+NULL NULL
+*/
+ getchar();
+ return 0;
+}
diff --git a/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/node.cpp b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/node.cpp
new file mode 100644
index 0000000..2c3f1db
--- /dev/null
+++ b/DataStructureAndAlgorithms/src/com/tree/TheImplementationOfTheBinaryTree/node.cpp
@@ -0,0 +1,52 @@
+#include
+using namespace std;
+
+class Node {
+public:
+ int data;
+ Node* left;
+ Node* right;
+ // Val is the key or the value that
+ // has to be added to the data part
+ Node(int val)
+ {
+ data = val;
+ // Left and right child for node
+ // will be initialized to null
+ left = NULL;
+ right = NULL;
+ }
+};
+
+int main()
+{
+ /*create root*/
+ Node* root = new Node(1);
+
+ /* following is the tree after above statement
+ 1
+ / \
+ NULL NULL
+ */
+ root -> left = new Node(2);
+ root -> right = new Node(3);
+
+ /* 2 and 3 become left and right children of 1
+ 1
+ / \
+ 2 3
+ / \ / \
+ NULL NULL NULL NULL
+ */
+ root -> left -> left = new Node(4);
+ /* 4 becomes left child of 2
+ 1
+ / \
+ 2 3
+ / \ / \
+ 4 NULL NULL NULL
+ / \
+ NULL NULL
+ */
+ return 0;
+}
diff --git a/DataStructureAndAlgorithms/src/com/tree/tree.png b/DataStructureAndAlgorithms/src/com/tree/tree.png
new file mode 100644
index 0000000..e905457
Binary files /dev/null and b/DataStructureAndAlgorithms/src/com/tree/tree.png differ
diff --git a/DataStructureAndAlgorithms/src/com/tree/tree1.png b/DataStructureAndAlgorithms/src/com/tree/tree1.png
new file mode 100644
index 0000000..c9065fb
Binary files /dev/null and b/DataStructureAndAlgorithms/src/com/tree/tree1.png differ
diff --git a/DataStructureAndAlgorithms/src/com/tree/tree2.png b/DataStructureAndAlgorithms/src/com/tree/tree2.png
new file mode 100644
index 0000000..242c1fe
Binary files /dev/null and b/DataStructureAndAlgorithms/src/com/tree/tree2.png differ
diff --git a/DataStructureAndAlgorithms/src/com/tree/tree3.png b/DataStructureAndAlgorithms/src/com/tree/tree3.png
new file mode 100644
index 0000000..a4b6d86
Binary files /dev/null and b/DataStructureAndAlgorithms/src/com/tree/tree3.png differ
diff --git a/DataStructureAndAlgorithms/src/com/tree/tree4.png b/DataStructureAndAlgorithms/src/com/tree/tree4.png
new file mode 100644
index 0000000..2e4ad7a
Binary files /dev/null and b/DataStructureAndAlgorithms/src/com/tree/tree4.png differ
diff --git a/README.md b/README.md
index 85df18d..efc84c0 100644
--- a/README.md
+++ b/README.md
@@ -7,4 +7,16 @@ In this course you will learn how to Analysis algorithms like Sorting, Searching
We will discus code complexity in Different algorithms like Sorting algorithms ( Bubble, Merge, Heap, and quick sort) , searching algorithms ( Binary search, linear search, and Interpolation), Graph algorithms( Binary tree, DFS, BFS, Nearest Neighbor and Shortest path, Dijkstra's Algorithm, and A* Algorithm). and Data Structure like Dynamic Array, Linked List, Stack, Queue, and Hash-Table
-
+
+
+
+## Classification of Data Structure:
+
+- Linear data structure:
Data structure in which data elements are arranged sequentially or linearly, where each element is attached to its previous and next adjacent elements, is called a linear data structure. Examples of linear data structures are array, stack, queue, linked list, etc.
+
+ - Static data structure:
Static data structure has a fixed memory size. It is easier to access the elements in a static data structure. An example of this data structure is an array.
+
+ - Dynamic data structure:
In dynamic data structure, the size is not fixed. It can be randomly updated during the runtime which may be considered efficient concerning the memory (space) complexity of the code. Examples of this data structure are queue, stack, etc.
+
+- Non-linear data structure:
Data structures where data elements are not placed sequentially or linearly are called non-linear data structures. In a non-linear data structure, we can’t traverse all the elements in a single run only. Examples of non-linear data structures are trees and graphs.
+
diff --git a/test.txt b/test.txt
new file mode 100644
index 0000000..e69de29