annotate Untitled.ipynb @ 12:77f0530f2eff

fix typo
author soto
date Thu, 11 Feb 2021 17:30:33 +0900
parents ce192a384cb6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
1 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
2 "cells": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
3 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
4 "cell_type": "code",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
5 "execution_count": 78,
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
6 "metadata": {},
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
7 "outputs": [],
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
8 "source": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
9 "# coding: utf-8\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
10 "#\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
11 "# llrbnode23.py : Left-Leaning Red Black Tree 用操作関数\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
12 "# (2-3 木バージョン)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
13 "#\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
14 "# Copyright (C) 2009 Makoto Hiroi\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
15 "#\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
16 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
17 "# 終端\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
18 "null = None\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
19 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
20 "# 色\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
21 "BLACK = 0\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
22 "RED = 1\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
23 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
24 "# 節\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
25 "class Node:\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
26 " def __init__(self, x, color = RED):\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
27 " self.data = x\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
28 " self.color = color\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
29 " self.left = null\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
30 " self.right = null\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
31 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
32 "# 終端の設定\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
33 "def make_null():\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
34 " global null\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
35 " if null is None:\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
36 " null = Node(None, BLACK)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
37 " null.left = None\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
38 " null.right = None\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
39 " return null\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
40 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
41 "# 右回転\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
42 "def rotate_right(node):\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
43 " lnode = node.left\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
44 " node.left = lnode.right\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
45 " lnode.right = node\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
46 " lnode.color = node.color\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
47 " node.color = RED\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
48 " return lnode\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
49 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
50 "# 左回転\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
51 "def rotate_left(node):\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
52 " rnode = node.right\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
53 " node.right = rnode.left\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
54 " rnode.left = node\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
55 " rnode.color = node.color\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
56 " node.color = RED\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
57 " return rnode\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
58 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
59 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
60 "#\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
61 "# データの挿入\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
62 "#\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
63 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
64 "# 4 node の分割\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
65 "def split(node):\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
66 " node.color = RED\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
67 " node.left.color = BLACK\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
68 " node.right.color = BLACK\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
69 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
70 "# 挿入\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
71 "def insert(node, x):\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
72 " if node is null: return Node(x)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
73 " if x < node.data:\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
74 " node.left = insert(node.left, x)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
75 " elif x > node.data:\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
76 " node.right = insert(node.right, x)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
77 " # skew\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
78 " if node.right.color == RED:\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
79 " print(\"hoge\",node.right.data)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
80 " print_node(node, 0)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
81 " node = rotate_left(node)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
82 " # split\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
83 " if node.left.color == RED and node.left.left.color == RED:\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
84 " node = rotate_right(node)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
85 " split(node)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
86 " return node\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
87 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
88 "# 木の表示\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
89 "def print_node(node, x):\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
90 " if node is not null:\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
91 " print_node(node.right, x + 1)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
92 " print(\"    \" * x, node.color, node.data)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
93 " print_node(node.left, x + 1)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
94 "\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
95 " \n"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
96 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
97 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
98 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
99 "cell_type": "code",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
100 "execution_count": 79,
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
101 "metadata": {},
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
102 "outputs": [],
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
103 "source": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
104 "root = make_null()"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
105 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
106 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
107 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
108 "cell_type": "code",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
109 "execution_count": 80,
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
110 "metadata": {},
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
111 "outputs": [],
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
112 "source": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
113 "root = insert(root, 0)\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
114 "root.color = BLACK\n"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
115 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
116 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
117 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
118 "cell_type": "code",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
119 "execution_count": 81,
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
120 "metadata": {},
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
121 "outputs": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
122 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
123 "name": "stdout",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
124 "output_type": "stream",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
125 "text": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
126 "         0 0\n"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
127 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
128 }
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
129 ],
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
130 "source": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
131 "print_node(root, 2)\n"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
132 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
133 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
134 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
135 "cell_type": "code",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
136 "execution_count": 82,
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
137 "metadata": {},
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
138 "outputs": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
139 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
140 "name": "stdout",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
141 "output_type": "stream",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
142 "text": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
143 "hoge 1\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
144 "     1 1\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
145 " 0 0\n"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
146 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
147 }
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
148 ],
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
149 "source": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
150 "root = insert(root, 1)"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
151 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
152 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
153 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
154 "cell_type": "code",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
155 "execution_count": 71,
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
156 "metadata": {},
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
157 "outputs": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
158 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
159 "name": "stdout",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
160 "output_type": "stream",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
161 "text": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
162 " 0 0\n"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
163 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
164 }
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
165 ],
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
166 "source": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
167 "print_node(root, 0)"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
168 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
169 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
170 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
171 "cell_type": "code",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
172 "execution_count": 52,
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
173 "metadata": {},
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
174 "outputs": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
175 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
176 "ename": "AttributeError",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
177 "evalue": "type object 'Node' has no attribute 'make_null'",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
178 "output_type": "error",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
179 "traceback": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
180 "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
181 "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
182 "\u001b[0;32m<ipython-input-52-6016b722b985>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0ma\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mNode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmake_null\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
183 "\u001b[0;31mAttributeError\u001b[0m: type object 'Node' has no attribute 'make_null'"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
184 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
185 }
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
186 ],
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
187 "source": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
188 "a=Node.make_null()"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
189 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
190 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
191 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
192 "cell_type": "code",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
193 "execution_count": 43,
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
194 "metadata": {},
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
195 "outputs": [],
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
196 "source": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
197 "a = Node.insert(a, 0)"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
198 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
199 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
200 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
201 "cell_type": "code",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
202 "execution_count": 44,
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
203 "metadata": {},
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
204 "outputs": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
205 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
206 "ename": "NameError",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
207 "evalue": "name 'print_node' is not defined",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
208 "output_type": "error",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
209 "traceback": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
210 "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
211 "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
212 "\u001b[0;32m<ipython-input-44-30dbdc80e254>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mNode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprint_node\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
213 "\u001b[0;32m<ipython-input-19-ffab890a4141>\u001b[0m in \u001b[0;36mprint_node\u001b[0;34m(node, x)\u001b[0m\n\u001b[1;32m 62\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mprint_node\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnode\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 63\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mnode\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mnull\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 64\u001b[0;31m \u001b[0mprint_node\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mleft\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 65\u001b[0m \u001b[0mprint\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m\" \"\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolor\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 66\u001b[0m \u001b[0mprint_node\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mright\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
214 "\u001b[0;31mNameError\u001b[0m: name 'print_node' is not defined"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
215 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
216 }
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
217 ],
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
218 "source": [
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
219 "Node.print_node(a, 0)"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
220 ]
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
221 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
222 {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
223 "cell_type": "code",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
224 "execution_count": null,
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
225 "metadata": {},
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
226 "outputs": [],
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
227 "source": []
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
228 }
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
229 ],
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
230 "metadata": {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
231 "kernelspec": {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
232 "display_name": "Python 3",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
233 "language": "python",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
234 "name": "python3"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
235 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
236 "language_info": {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
237 "codemirror_mode": {
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
238 "name": "ipython",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
239 "version": 3
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
240 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
241 "file_extension": ".py",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
242 "mimetype": "text/x-python",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
243 "name": "python",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
244 "nbconvert_exporter": "python",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
245 "pygments_lexer": "ipython3",
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
246 "version": "3.7.0"
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
247 }
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
248 },
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
249 "nbformat": 4,
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
250 "nbformat_minor": 2
ce192a384cb6 WIP add imple
soto
parents:
diff changeset
251 }