Skip to main content

Posts

Showing posts from 2017

700 problems to understand you complete algorithmic programming.

700 problems to understand you complete algorithmic programming. 1. Segment Tree: To Read : http://www.topcoder.com/tc?d1=tutorials&d2=lowestCommonAncestor&module=Static http://ronzii.wordpress.com/2011/07/08/segment-tree-tutorial/ http://se7so.blogspot.in/2012/12/segment-trees-and-lazy-propagation.html http://olympiad.cs.uct.ac.za/presentations/camp3_2007/interval_trees.pdf http://codeforces.com/blog/entry/6281 http://apps.topcoder.com/forums/?module=Thread&threadID=651820&start=0&mc=2#1146133 http://www.algorithmist.com/index.php/Segmented_Trees http://letuskode.blogspot.in/2013/01/segtrees.html http://wcipeg.com/wiki/Heavy-light_decomposition http://discuss.codechef.com/questions/5960/rnestescape-from-the-mines http://ideone.com/dPS5N  (Heavy Light implementation). https://sites.google.com/site/indy256/algo/heavy_light  (Heavy Light implementation). Problems: http://www.spoj.com/problems/GSS1 http://www.spoj.com/problems/GSS2 http://www.spoj.com...

Binary Search Tree - BST implementation

Binary Search Tree - BST implementation # include < stdio.h > # include < stdlib.h > typedef struct tree { int number; struct tree *leftChild; struct tree *rightChild; } node; node *root= NULL ; void insertNode ( int value); void searchOnTree ( int value); void preOrderPrint (node *rootNode); void inOrderPrint (node *rootNode); void postOrderPrint (node *rootNode); int main () { insertNode ( 45 ); insertNode ( 54 ); insertNode ( 40 ); insertNode ( 49 ); insertNode ( 38 ); insertNode ( 70 ); insertNode ( 30 ); insertNode ( 39 ); insertNode ( 41 ); insertNode ( 45 ); insertNode ( 44 ); printf ( " \n Pre-Order Tree printing: \n " ); preOrderPrint (root); puts ( " " ); printf ( " \n In-Order Tree printing: \n " ); inOrderPrint (root); puts ( " " ); printf ( " \n Post-Order Tree p...