Traversal

path traversal

什么是路径遍历?路径遍历也称为目录遍历。这些漏洞使攻击者能够读取运行应用程序的服务器上的任意文件。这可能包括:应用程序代码和数据。后端系统的凭据。敏感的操作系统文件。在某些情况下,攻击者可能能够写入服务器上的任意文件,从而允许他们修改应用程序数据或行为,并最终完全控制服务器。如何防止路径遍历攻击防止 ......
traversal path

145. Binary Tree Postorder Traversal

public List<Integer> postorderTraversal(TreeNode root) { List<Integer> list = new ArrayList<>(); if (root == null) return list; Stack<TreeNode> stack ......
Postorder Traversal Binary Tree 145

144. Binary Tree Preorder Traversal

Solution 1://非递归 public List<Integer> preorderTraversal(TreeNode root) { List<Integer> result = new ArrayList<>(); if (root == null) { return result; ......
Traversal Preorder Binary Tree 144

Binary Tree Level Order Traversal II

Source Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root ......
Traversal Binary Level Order Tree

线索二叉树(Morris Traversal)

在前面的文章中总结了二叉树的一些操作,提供了二叉树前中后的递归和非递归的实现。在非递归的实现中,基本思想是利用栈来模拟递归调用遍历的过程,本质上和递归实现没有区别,空间复杂度为\(O(n)\)。是否存在一种算法,它不使用栈也不破坏二叉树结构,但是可以完成对二叉树的遍历?即: 空间复杂度为\(O(1) ......
线索 Traversal Morris

Binary Tree Level Order Traversal

Source Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). Example Given binary tree ......
Traversal Binary Level Order Tree

Binary Tree Postorder Traversal

Source Given a binary tree, return the postorder traversal of its nodes' values. Example Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [3,2,1]. Challe ......
Postorder Traversal Binary Tree

1138 Postorder Traversal

题目: Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to ......
Postorder Traversal 1138

Binary Tree Inorder Traversal

Source Given a binary tree, return the inorder traversal of its nodes' values. Example Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,3,2]. Challeng ......
Traversal Inorder Binary Tree

Binary Tree Preorder Traversal

Source Given a binary tree, return the preorder traversal of its nodes' values. Note Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,2,3]. Example Ch ......
Traversal Preorder Binary Tree

Binary Tree Inorder Traversal

Given the root of a binary tree, return the inorder traversal of its nodes' values. Example 1: ``` Input: root = [1,null,2,3] Output: [1,3,2] ``` Exam ......
Traversal Inorder Binary Tree

CF1819C The Fox and the Complete Tree Traversal

# [$\color{purple}\text{The Fox and the Complete Tree Traversal}$](https://www.luogu.com.cn/problem/CF1819C) 比较有意思的一题。先考虑一个序列的权值。对长度为 $len$ 的序列排序,价值为 ......
Traversal Complete 1819C 1819 Tree

树的遍历(traversal)

Traversal一般指遍历。 所谓遍历(Traversal),是指沿着某条搜索路线,依次对树(或图)中每个节点均做一次访问。访问结点所做的操作依赖于具体的应用问题, 具体的访问操作可能是检查节点的值、更新节点的值等。不同的遍历方式,其访问节点的顺序是不一... ......
traversal

Codeforces Round 866 (Div. 1) C. The Fox and the Complete Tree Traversal (构造)

传送门 题目大意: ** 给定一个有n个点的树,我们可以任意选择一个点作为起点,这个点可以跳到跟自己距离为1或者距离为2的点,已经到达的点不能再到达(最终必须回到起点),询问是否存在一种方案可以从一个点出发经过所有的点最终再回到这个点来。** ** 输入一个整数n。紧接着输入n-1条边。** 大致思 ......
Codeforces Traversal Complete Round Tree
共14篇  :1/1页 首页上一页1下一页尾页