{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":354403404,"defaultBranch":"main","name":"Arduino-Library","ownerLogin":"iot-Noob","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2021-04-03T22:02:48.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/38003373?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1689059296.0","currentOid":""},"activityList":{"items":[{"before":"5ee81a458aa543042eb9a0290d7cdbde7f42f41c","after":"a59064f4091e9a028eb472ee3e1e60881c63bbe9","ref":"refs/heads/main","pushedAt":"2023-07-11T07:08:17.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"iot-Noob","name":"Noob Programmer","path":"/iot-Noob","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/38003373?s=80&v=4"},"commit":{"message":"Add files via upload","shortMessageHtmlLink":"Add files via upload"}},{"before":"7b25548e58852c6c7dd1a4d91b3a45a985c930e0","after":"5ee81a458aa543042eb9a0290d7cdbde7f42f41c","ref":"refs/heads/main","pushedAt":"2023-07-10T17:58:55.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"iot-Noob","name":"Noob Programmer","path":"/iot-Noob","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/38003373?s=80&v=4"},"commit":{"message":"Binary Tree\n\nThe provided code represents the implementation of a binary tree in the form of a C++ template class, BinaryTree. Here's a description of the code and its functionality:\r\n\r\nThe BinaryTree class represents a binary tree data structure, which consists of nodes that hold values of a generic type T.\r\n\r\nThe private section of the class defines a nested Node structure, which represents a single node in the binary tree. Each node contains the value of type T and pointers to its left and right child nodes.\r\n\r\nThe root member variable is a pointer to the root node of the binary tree.\r\n\r\nThe class provides various functions to manipulate and interact with the binary tree:\r\n\r\nclearRecursive: A private helper function that recursively clears the binary tree by deleting each node and freeing memory.\r\ninsertRecursive: A private helper function that recursively inserts a value into the binary tree in the appropriate position based on its comparison to existing node values.\r\nIsPresent: A private helper function that recursively checks if a value is present in the binary tree.\r\nFind: A private helper function that recursively searches for a value in the binary tree and returns a pointer to the node containing the value.\r\nfindMin: A private helper function that finds the minimum value node in a subtree.\r\ndeleteRecursive: A private helper function that recursively deletes a node with a given value from the binary tree.\r\nbfsRecursive: A private helper function that performs a breadth-first search traversal of the binary tree and executes a callback function on each node's value.\r\ndfsRecursive: A private helper function that performs a depth-first search traversal of the binary tree and executes a callback function on each node's value.\r\nThe public section of the class defines the following functions:\r\n\r\nBinaryTree(): The constructor initializes the root pointer to nullptr, indicating an empty binary tree.\r\n~BinaryTree(): The destructor calls the clear() function to clear the binary tree and free memory.\r\ninsert: Inserts a new element with the given value into the binary tree using the insertRecursive function.\r\nPresent: Checks if a value is present in the binary tree using the IsPresent function. Returns true if the value is found, false otherwise.\r\nsearch: Searches for a value in the binary tree using the Find function and returns a pointer to the node containing the value.\r\nremove: Removes a node with the given value from the binary tree using the deleteRecursive function.\r\nclear: Clears the binary tree by calling the clearRecursive function.\r\nbfs: Performs a breadth-first search traversal of the binary tree and executes a callback function on each node's value using the bfsRecursive function.\r\ndfs: Performs a depth-first search traversal of the binary tree and executes a callback function on each node's value using the dfsRecursive function.\r\nThis implementation provides the basic functionality to create, manipulate, and traverse a binary tree using the BinaryTree class. The template nature of the class allows it to work with different types of data. You can instantiate objects of the BinaryTree class with specific types, such as integers, strings, or custom objects, and perform operations on the binary tree accordingly.","shortMessageHtmlLink":"Binary Tree"}},{"before":"39a2716d1887df734f8dfb8f693d08a514d40023","after":"7b25548e58852c6c7dd1a4d91b3a45a985c930e0","ref":"refs/heads/main","pushedAt":"2023-07-10T17:39:05.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"iot-Noob","name":"Noob Programmer","path":"/iot-Noob","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/38003373?s=80&v=4"},"commit":{"message":"Arduino-QueueList-master","shortMessageHtmlLink":"Arduino-QueueList-master"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAADUuA2vwA","startCursor":null,"endCursor":null}},"title":"Activity ยท iot-Noob/Arduino-Library"}