data-structures-and-algorithms

401 data structures and algorithms code challenges


Project maintained by alsosteve Hosted on GitHub Pages — Theme by mattgraham

Data Structures and Algorithms

Language: Python

Trees

Feature Tasks

Challenge Type: New Implementation

Node

Binary Tree

Binary Search Tree

Whiteboard Process

challenge15

Examples

None

Unit Tests

  1. Can successfully instantiate an empty tree
  2. Can successfully instantiate a tree with a single root node
  3. For a Binary Search Tree, can successfully add a left child and right child properly to a node
  4. Can successfully return a collection from a preorder traversal
  5. Can successfully return a collection from an inorder traversal
  6. Can successfully return a collection from a postorder traversal
  7. Returns true false for the contains method, given an existing or non-existing node value

Stretch Goal

Create a new branch called k-ary-tree, and, using the resources available to you online, implement a k-ary tree, where each node can have any number of children.

Approach & Efficiency