当前位置 : 主页 > 手机开发 > harmonyos >

leetcode-426-Convert Binary Search Tree to Sorted Doubly Linked List

来源:互联网 收集:自由互联 发布时间:2023-08-26
error: cannot solve it. use a previous node to store last inorder variable, then perform inroder traverse. pattern: inorder(root-left); prev-left = root; root-right = prev; prev = root; inorder(root-right);


error:
cannot solve it.

  • use a previous node to store last inorder variable, then perform inroder traverse.
pattern:
  	inorder(root->left);
  	prev->left = root;
  	root->right = prev;
  	prev = root;
  	inorder(root->right);


上一篇:leetcode-139-Word Break
下一篇:没有了
网友评论