Skip to content

Binary Tree #18

Closed
Closed

Description

@Migutti

In line 18, the heap view is not working as it jumps from one child to the other in the binary tree.

#include <stdio.h>
#include <stdlib.h>

struct TreeNode
{
  int data;
  struct TreeNode* left;
  struct TreeNode* right;
};

int main()
{
  struct TreeNode* root = (struct TreeNode*)malloc(sizeof(struct TreeNode));
  root->data = 1;
  root->left = (struct TreeNode*)malloc(sizeof(struct TreeNode));
  root->left->data = 2;
  root->right = (struct TreeNode*)malloc(sizeof(struct TreeNode));
  root->right->data = 3;

  return 0;
}

Activity

  1. moved this from Todo to Done in Stackiumon Sep 14, 2024
  2. added a commit that references this issue on Nov 23, 2024
    ed91d07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions