---
title: "Discussion on \"Building a tree from preorder + inorder\" | Hashnode"
description: "Discussion on \"Building a tree from preorder + inorder\". Preorder tells you which node is the root. Inorder tells you which nodes go to its left and which go to its right. Take one root at a time, split the arrays, and recurse. With a hashmap and a pointer"
url: "https://hashnode.com/posts/building-a-tree-from-preorder-inorder/6b0258f9bf1b7b2940db90ec"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Building a tree from preorder + inorder](https://basecase-utkarsh.hashnode.dev/building-a-tree-from-preorder-inorder?utm_source=hashnode&utm_medium=feed)

Preorder tells you which node is the root. Inorder tells you which nodes go to its left and which go to its right. Take one root at a time, split the arrays, and recurse. With a hashmap and a pointer

Nov 22 · 6 min read · basecase-utkarsh.hashnode.dev  
Read the article

## Written by

[Utkarsh Shrivastava](https://hashnode.com/@utkarshinobi)

@utkarshinobi · San Francisco, USA

  
[View profile](https://hashnode.com/@utkarshinobi)

Algorithms, AI Engineering, Full Stack Systems

Code got cheap. Being right didn’t. Writing about AI engineering, distributed systems, algorithms, and product.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
