binary-tree
inserting nodes into a binary tree in java question
im coming from c++ to java and开发者_开发技巧 i am confused on binary trees with java. is the only way to have a Node class is to make it an inner static class? all the examples i see do this.However,[详细]
2023-02-22 03:09 分类:问答Explain Morris inorder tree traversal without using stacks or recursion
Can someone please help me understand the following Morris inorder tree traversal algorithm without using stacks or recursion ? I was trying to understand how it works, but its just escaping me.[详细]
2023-02-21 07:08 分类:问答Write a non-recursive traversal of a Binary Search Tree using constant space and O(n) run time
This is not homework, this is an interview question. The catch here is 开发者_运维知识库that the algorithm should be constant space.[详细]
2023-02-20 18:28 分类:问答Basic BST Question From a New Programmer
Given the data set (8, 1, 6, 9, 3, 5, 4, 7) I drew the following binary search tree: 8 / \\ 19 \\ 6 / \\ 37[详细]
2023-02-20 12:22 分类:问答Storing a stack in a recursive function
I am trying to search through a binary search tree and store e开发者_JAVA技巧ach node in a stack as I traverse through the tree in order to remember my path so that I can perform rotations.[详细]
2023-02-20 10:23 分类:问答Deletion in Binary Search Tree
Why is 开发者_如何学Cdeletion in a BST a O(log(n)) operation. As i undersand it involves freeing a node and pointing the parent\'s reference to NULL. Shouldn\'t this take O(1)The issue is how to delet[详细]
2023-02-20 02:31 分类:问答Why is this binary tree code wrong?
I\'m coding something I thought was simple for my programming class but I\'m a开发者_JAVA技巧 little stuck :S, could someone take a look at my code, and help me? Thx[详细]
2023-02-19 20:05 分类:问答Reading a Balanced Binary Tree in Order
I\'m working on a project for my data structures class that wants me to read a text file and put each line on a balanced binary tree. It is my understanding 开发者_Go百科that this structure will look[详细]
2023-02-19 20:05 分类:问答Multiple Array Merge Using Binary Heap
Given k sorted arrays of integers, each containing an unknown positive number of elements (not necessarily the same numb开发者_运维问答er of elements in each array), where the total number of elements[详细]
2023-02-19 19:44 分类:问答How can I print a binary tree level by level
How would you print out the data in a binary tree, level by level, starting at the top, with python? I\'m very new with this and I don\'t have any idea how to start.[详细]
2023-02-19 19:25 分类:问答