我们如何在文件中保存BST树的子级(使用Objecyt I/O) [英] How we save the children of BST tree on File(Using Objecyt I/O)
本文介绍了我们如何在文件中保存BST树的子级(使用Objecyt I/O)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
给我在自己的代码中使用的简单代码.
我仍然想将树的对象存储在文件中
所有的孩子都成功地存储在文件中 但是文件它没有显示我已存储的树的实际数据.如果有人有想法,请帮助我大约7天,但在这项工作中没有成功.实际上,我正在构建AVL树.
解决方案
这完全取决于您如何保存数据.
您确实意识到,您不仅可以保存指向文件的指针,而且希望它们在回读时能正常工作,对吗?解决方案指的是使用序列化来做到这一点.尝试搜索问题.
[edit]
实际上,正如我通过检查发现的那样,昨天在有关此主题的原始问题中,为您提供了解决方案.我建议您尝试实现它,而不仅仅是重复这个问题.
[/edit]
Give ME Simple Code I use in Our Own Code .
I m still tring to store objects of tree on file
all childs are storeds on file successfully BUT there is problem when i read from file It not shows me Actual Data of tree that i have stored .If Any one have an Idea please Help Me i m doing this approximately 7 days but not successful in this work.Actually i build AVL tree.
解决方案
It''s all going to depend on how you saved the data.
You do realize that you can''t just save pointers to a file, and expect them to work when you read them back, right?
There was a question about this yesterday and the suggested solution referred to using serialization to do it. Try searching through the questions.
[edit]
In fact, as I just found by checking, the solution was given to you yesterday in your original question on this subject. I suggest you try implementing it rather than just repeating this question.
[/edit]
这篇关于我们如何在文件中保存BST树的子级(使用Objecyt I/O)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文