10 2018 档案

摘要:Given an n-ary tree, return the preorder traversal of its nodes' values. For example, given a 3-ary tree: Return its preorder traversal as: [1,3,5,6,2 阅读全文
posted @ 2018-10-31 10:48 Grandyang 阅读(3405) 评论(1) 推荐(1) 编辑
摘要:Given an n-ary tree, return the postorder traversal of its nodes' values. For example, given a 3-ary tree: Return its postorder traversal as: [5,6,3,2 阅读全文
posted @ 2018-10-31 10:11 Grandyang 阅读(2493) 评论(2) 推荐(0) 编辑
摘要:Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest le 阅读全文
posted @ 2018-10-29 21:41 Grandyang 阅读(3516) 评论(3) 推荐(0) 编辑
摘要:A quadtree is a tree data in which each internal node has exactly four children: topLeft, topRight, bottomLeft and bottomRight. Quad trees are often u 阅读全文
posted @ 2018-10-24 23:44 Grandyang 阅读(2096) 评论(0) 推荐(0) 编辑
摘要:在3D Slicer中,我们如果想在自己写的插件中来修改三维视图中的默认设置的话,那么首先就需要获得三维视图的结点,其类型为vtkMRMLViewNode,获得了这个结点后,我们就可以用代码来修改一系列属性了,比如隐藏方框和坐标轴标签等。这里我们通过使用系统函数getNode()来获得三维视图节点, 阅读全文
posted @ 2018-10-19 04:06 Grandyang 阅读(799) 评论(0) 推荐(0) 编辑
摘要:Given an array w of positive integers, where w[i] describes the weight of index i, write a function pickIndex which randomly picks an index in proport 阅读全文
posted @ 2018-10-13 23:05 Grandyang 阅读(13121) 评论(5) 推荐(1) 编辑
摘要:You are given the number of rows n_rows and number of columns n_cols of a 2D binary matrix where all values are initially 0. Write a function flip whi 阅读全文
posted @ 2018-10-12 23:32 Grandyang 阅读(3416) 评论(2) 推荐(0) 编辑
摘要:Given a list of non-overlapping axis-aligned rectangles rects, write a function pick which randomly and uniformily picks an integer point in the space 阅读全文
posted @ 2018-10-07 23:54 Grandyang 阅读(4231) 评论(7) 推荐(0) 编辑
摘要:Given the radius and x-y positions of the center of a circle, write a function randPoint which generates a uniform random point in the circle. Note: E 阅读全文
posted @ 2018-10-03 23:09 Grandyang 阅读(4190) 评论(6) 推荐(0) 编辑

Fork me on GitHub