How to save something in memory to file?
-
So I have implemented the binary tree shown here (http://msdn.microsoft.com/en-us/library/ms379572.aspx[^]). I have no prior knowledge in I/O and its related areas, so any quick reads would be nice. My question is, how would i save the tree (including the root as well as the internal and leaf nodes) into a file? How would i use the file after its saved? I have a decoder (just a simple program that traverses all of the tree's nodes and writes them out in console), but I would have no idea how to recall the file and decode it. Any help is appreciated.
-
So I have implemented the binary tree shown here (http://msdn.microsoft.com/en-us/library/ms379572.aspx[^]). I have no prior knowledge in I/O and its related areas, so any quick reads would be nice. My question is, how would i save the tree (including the root as well as the internal and leaf nodes) into a file? How would i use the file after its saved? I have a decoder (just a simple program that traverses all of the tree's nodes and writes them out in console), but I would have no idea how to recall the file and decode it. Any help is appreciated.
-
So I have implemented the binary tree shown here (http://msdn.microsoft.com/en-us/library/ms379572.aspx[^]). I have no prior knowledge in I/O and its related areas, so any quick reads would be nice. My question is, how would i save the tree (including the root as well as the internal and leaf nodes) into a file? How would i use the file after its saved? I have a decoder (just a simple program that traverses all of the tree's nodes and writes them out in console), but I would have no idea how to recall the file and decode it. Any help is appreciated.
What I would do is firstly save the traversal. Pre / Post. And then the data. .Net makes IO easy. Try the StreamWriter and StreamReader classes
Stephen Lintott Bsc IT (RAU)