Skip to main content

Posts

Featured

All about Trie Data Structure

// trei is a data structure which has an array and a leaf  // array points to the next tries and leaf  // tells whether this word ends or not. #include   <bits/stdc++.h> using   namespace   std ;   class   Node {      public:      Node *  arr[ 26 ];      bool  leaf;      Node (){          for ( int  i = 0 ;i < 26 ;i ++ ) arr[i]  =   NULL ;         leaf  =   false ;     } }; //recursive functions: void   addHelper ( Node *   root ,  string   & word ,  int   idx ){     //base case:      if ( idx   ==   wo...

Latest Posts

Open CV Basics

All Binary Tree Codes 23 jan: