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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:在3D Slicer中,我们如果想在自己写的插件中来修改三维视图中的默认设置的话,那么首先就需要获得三维视图的结点,其类型为vtkMRMLViewNode,获得了这个结点后,我们就可以用代码来修改一系列属性了,比如隐藏方框和坐标轴标签等。这里我们通过使用系统函数getNode()来获得三维视图节点,
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文