码迷,mamicode.com
首页 >  
搜索关键字:oc 遍历    ( 32540个结果
python实现文件解压,遍历及使用winrm模块上传到Windows主机
import os import tarfile import zipfile import threading import winrm LOCAL_FILE_PATH = "C:\\" THREAD_MAX = threading.BoundedSemaphore(10) CONN_FLAG = ...
分类:编程语言   时间:2020-07-14 13:25:40    阅读次数:100
[PAT] A1043 Is It a Binary Search Tree
(熟练!重要!)二叉搜索树 BST ##题目大意 判断给定序列是否是一个BST或镜像BST树的先序遍历序列,如果是则输出该树的后序遍历序列。 ##思路 根据给定序列创建BST树,求出它的先序遍历和镜像树的先序遍历(即原树遍历时按照根->右->左),与原序列比较。 ##AC代码 #define _CR ...
分类:其他好文   时间:2020-07-14 11:52:38    阅读次数:62
如何决定使用 HashMap 还是 TreeMap?
问:如何决定使用 HashMap 还是 TreeMap? 介绍 TreeMap<K,V>的Key值是要求实现java.lang.Comparable,所以迭代的时候TreeMap默认是按照Key值升序排序的;TreeMap的实现是基于红黑树结构。适用于按自然顺序或自定义顺序遍历键(key)。 Has ...
分类:其他好文   时间:2020-07-14 10:39:15    阅读次数:55
0434. Number of Segments in a String (E)
Number of Segments in a String (E) 题目 Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space ch ...
分类:其他好文   时间:2020-07-14 09:24:30    阅读次数:84
java接口开发根据数据字典内容编写对应的接口
1.在页面中: <el-form-item label="课程等级" prop="grade"> <b v-for="grade in gradeList"> //遍历gradeList <el-radio v-model="courseForm.grade" :label="grade.sdId" ...
分类:编程语言   时间:2020-07-14 00:46:06    阅读次数:104
[PAT] A1053 Path of Equal Weight
(要熟练!)(树的遍历) ##题目大意 (题目链接)https://pintia.cn/problem-sets/994805342720868352/problems/994805424153280512 题目大意:给出树的结构和权值,找从根结点到叶子结点的路径上的权值相加之和等于给定目标数的路径 ...
分类:其他好文   时间:2020-07-14 00:27:26    阅读次数:59
Array.forEach Array.map Array.filter的用法
1. Array.forEach 循环 let arr = [1,2,3,4,5] arr.forEach(item=>{ console.log(item) }) 1 2 3 4 5 2.Array.map 遍历并生成新的数组 map方法不改变源数据,需要用变量接收,注意return的每一个值是新 ...
分类:其他好文   时间:2020-07-13 23:07:34    阅读次数:92
python3内置函数
一、列举enumerate() 1 改函数用于将一个可遍历类型组合成一个带索引序列,可同时列出数据下标和数据本身,一般用在for循环中。 2 >>> s = ["北京", "上海", "深圳", "广州"] 3 >>> for i in enumerate(s): 4 i[0], i[1] 5 6 ...
分类:编程语言   时间:2020-07-13 21:40:11    阅读次数:79
LeetCode 树 116. 填充每个节点的下一个右侧节点指针(层序遍历 分层)
题目的要求,大白话说就是:把指针指向同层的右侧节点 提到同层,自然就要想到层序遍历,自然是队列实现 问题是需要分层 所以采用之前题目用的那种计数的方式 class Solution { public Node connect(Node root) { if(root==null) {return r ...
分类:其他好文   时间:2020-07-13 18:42:31    阅读次数:79
BFS广度遍历代码模板
BFS广度遍历代码模板 /** 广度遍历代码模板 */ public class TestBFS { public List<List<Integer>> bsf(TreeNode root) { // 如果节点为空 if (root == null) { return null; } List<L ...
分类:其他好文   时间:2020-07-13 18:26:06    阅读次数:70
32540条   上一页 1 ... 91 92 93 94 95 ... 3254 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!