{"id":76181,"date":"2024-07-20T20:14:22","date_gmt":"2024-07-21T00:14:22","guid":{"rendered":"https:\/\/bangla.sitestree.com\/?p=76181"},"modified":"2024-07-28T17:02:54","modified_gmt":"2024-07-28T21:02:54","slug":"struct-and-tree-node","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=76181","title":{"rendered":"Struct and Tree Node"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\/\/ Ref: typedef and struct\n\/\/ https:\/\/www.w3resource.com\/c-programming-exercises\/c-snippets\/difference-between-typedef-struct-and-struct-definitions-with-example.php#google_vignette\n\/\/ https:\/\/www.tutorialspoint.com\/cprogramming\/c_pointers.htm\n\/\/ https:\/\/www.geeksforgeeks.org\/typedef-in-c\/\n\n#pragma warning(disable : 4996)\n\n#include &lt;iostream>\n#include &lt;string.h>\n\n\/\/ Declare a structure that holds data in a node\ntypedef struct {\n\tint num;\n} NodeData;\n\n\/\/ define what a node will look like\ntypedef struct treenode {\n\tNodeData data;\n\tstruct treenode *left, *right;\n} t1;\n\n\/\/ main method\nint main()\n{\n\tstd::cout &lt;&lt; \"Hello World 2!\\n\";\t\t\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1966,1883,182],"tags":[],"class_list":["post-76181","post","type-post","status-publish","format-standard","hentry","category-data-structure-and-algorithms","category---data-structure","category---blog","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":76185,"url":"http:\/\/bangla.sitestree.com\/?p=76185","url_meta":{"origin":76181,"position":0},"title":"A Binary Tree Declaration","author":"Sayed","date":"July 20, 2024","format":false,"excerpt":"#include <stdio.h> #include <stdlib.h> \/\/ Declare a structure that holds data in a node typedef struct { int num; } NodeData; typedef struct treeNode { NodeData data; struct treeNode* left, * right; } TreeNode, *TreeNodePtr; typedef struct { TreeNodePtr root; } BinaryTree; \/\/ main method int main() { \/\/ NULL\u2026","rel":"","context":"In &quot;Data Structure and Algorithms&quot;","block_context":{"text":"Data Structure and Algorithms","link":"http:\/\/bangla.sitestree.com\/?cat=1966"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76183,"url":"http:\/\/bangla.sitestree.com\/?p=76183","url_meta":{"origin":76181,"position":1},"title":"Struct and Tree Node Examples","author":"Sayed","date":"July 20, 2024","format":false,"excerpt":"#include <iostream> #include <string.h> #pragma warning(disable : 4996) #define MaxWordSize 100 \/\/ Declare a structure that holds data in a node typedef struct { int num; } NodeDataInt; \/\/ Declare a structure that holds data in a node typedef struct { char word[MaxWordSize + 1]; int freq; } NodeDataChar; \/\/\u2026","rel":"","context":"In &quot;Data Structure and Algorithms&quot;","block_context":{"text":"Data Structure and Algorithms","link":"http:\/\/bangla.sitestree.com\/?cat=1966"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76187,"url":"http:\/\/bangla.sitestree.com\/?p=76187","url_meta":{"origin":76181,"position":2},"title":"C Code Build a Binary Tree.","author":"Sayed","date":"July 20, 2024","format":false,"excerpt":"#include <iostream> #include <string.h> #include <stdlib.h> #pragma warning(disable : 4996) #define MaxWordSize 100 \/\/ Declare a structure that holds data in a node typedef struct { char word[MaxWordSize + 1]; } NodeData; typedef struct treeNode { NodeData data; struct treeNode* left, * right; } TreeNode, *TreeNodePtr; typedef struct { TreeNodePtr\u2026","rel":"","context":"In &quot;Data Structure and Algorithms&quot;","block_context":{"text":"Data Structure and Algorithms","link":"http:\/\/bangla.sitestree.com\/?cat=1966"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76179,"url":"http:\/\/bangla.sitestree.com\/?p=76179","url_meta":{"origin":76181,"position":3},"title":"Struct\/Record Examples in C Programming Language","author":"Sayed","date":"July 20, 2024","format":false,"excerpt":"#pragma warning(disable : 4996) #include <iostream> #include <string.h> \/\/struct struct student { char name[50]; int age; float height; }; struct student s1 = { \" Nina Chase\", 12, 1.55 }; struct student s2 = { \" Shyann Morris\", 12, 1.65 }; \/\/typedef struct typedef struct { char name[50]; int age;\u2026","rel":"","context":"In &quot;Data Structure and Algorithms&quot;","block_context":{"text":"Data Structure and Algorithms","link":"http:\/\/bangla.sitestree.com\/?cat=1966"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76173,"url":"http:\/\/bangla.sitestree.com\/?p=76173","url_meta":{"origin":76181,"position":4},"title":"Nodes: Vertices and Edges. Nodes for them","author":"Sayed","date":"July 20, 2024","format":false,"excerpt":"define MaxWordSize 100 #define MaxWordSize 100 \/\/edge of a graph typedef struct gEdge{ \/\/ child is the location of the child vertex int child, weight; struct gEdge *nextEdge; } GEdge, *GEdgePtr; typedef struct{ char id[MaxWordSize]; int parent, cost, discover, finish, inDegree; GEdgePtr firstEdge; } GVertex; \/\/main method int main() {\u2026","rel":"","context":"In &quot;Data Structure and Algorithms&quot;","block_context":{"text":"Data Structure and Algorithms","link":"http:\/\/bangla.sitestree.com\/?cat=1966"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8374,"url":"http:\/\/bangla.sitestree.com\/?p=8374","url_meta":{"origin":76181,"position":5},"title":"\u09b8\u09bf \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0999\u09c7 typedef \u098f\u09b0 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0","author":"Author-Check- Article-or-Video","date":"April 4, 2015","format":false,"excerpt":"\u09b8\u09bf \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0999\u09c7 typedef \u098f\u09b0 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u0983 \u09b0\u09bf\u09a6\u0993\u09df\u09be\u09a8 \u09ac\u09bf\u09a8 \u09b6\u09be\u09ae\u09c0\u09ae \u09b8\u09bf \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 \u09b2\u09cd\u09af\u09be\u0999\u09cd\u0997\u09c1\u09df\u09c7\u099c typedef \u09a8\u09be\u09ae\u09c7\u09b0 \u098f\u0995\u099f\u09bf \u0995\u09bf-\u0993\u09df\u09be\u09b0\u09cd\u09a1 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09a4\u09c7 \u09a6\u09c7\u09df, \u09af\u09be \u09a8\u09a4\u09c1\u09a8 \u09a8\u09be\u09ae \u099f\u09be\u0987\u09aa \u0995\u09b0\u09a4\u09c7 \u09a6\u09c7\u09df, \u09a8\u09bf\u099a\u09c7\u09b0 \u0989\u09a6\u09be\u09b9\u09b0\u09a3\u09c7 BYTE \u099f\u09be\u09b0\u09cd\u09ae \u09ac\u09bf\u09ac\u09c3\u09a4 \u0995\u09b0\u09be \u09b9\u09df\u09c7\u099b\u09c7\u0964 typedef unsigned char BYTE; \u09ac\u09bf\u09ac\u09c3\u09a4 \u0995\u09b0\u09be\u09b0 \u09aa\u09b0 unsigned char \u098f\u09b0 \u09ac\u09cd\u09af\u09be\u0996\u09cd\u09af\u09be \u09b9\u09bf\u09b8\u09be\u09ac\u09c7 BYTE identifier \u09b0\u09c2\u09aa\u09c7 \u0995\u09be\u099c \u0995\u09b0\u09c7\u0964 \u09af\u09c7\u09ae\u09a8, BYTE\u2026","rel":"","context":"In &quot;\u09aa\u09cd\u09b0\u09be\u09a5\u09ae\u09bf\u0995 \u09b8\u09bf \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 \u0964 C Programming Basics&quot;","block_context":{"text":"\u09aa\u09cd\u09b0\u09be\u09a5\u09ae\u09bf\u0995 \u09b8\u09bf \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09bf\u0982 \u0964 C Programming Basics","link":"http:\/\/bangla.sitestree.com\/?cat=239"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76181"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76181\/revisions"}],"predecessor-version":[{"id":76182,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76181\/revisions\/76182"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76181"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}