- 博客(79)
- 资源 (2)
- 收藏
- 关注
原创 Spiral-matrix-ii
题目描述Given an integer n, generate a square matrix filled with elements from 1 to n 2 in spiral order.For example,Given n =3,You should return the following matrix:[ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6,...
2018-06-27 11:17:13
184
原创 Trapping-rain-water
题目描述Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given[0,1,0,2,1,0,1,3,2,1,2,1], r...
2018-06-27 09:33:25
327
转载 ryu启动问题总结
在Mininet中启动ryu控制器,首先切换到ryu中的app目录下: 1 cd ryu/ryu/app 启动ryu: 1 ryu-manager simple_switch.py 遇到了如下的错误提示: 这种问题都是由于文件的版本问题导致的,上图显示了启动问题是由于pbr导致的,所以更新或者安装pbr即可解决这个问题,运行如下命令: ...
2018-06-26 17:35:37
3724
原创 Remove-duplicates-from-sorted-array
题目描述Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with...
2018-06-25 10:37:58
251
原创 Gray-code
题目描述The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of ...
2018-06-25 10:05:53
234
转载 Java中有关string
String,是Java中除了基本数据类型以外,最为重要的一个类型了。很多人会认为他比较简单。但是和String有关的面试题有很多,下面我随便找两道面试题,看看你能不能都答对:Q1:String s = new String("hollis");定义了几个对象。Q2:如何理解String的intern方法?上面这两个是面试题和String相关的比较常考的,很多人一般都知道答案。A1:若常量池中已经...
2018-06-25 09:26:28
353
原创 Sort-colors
题目描述Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers ...
2018-06-24 19:40:42
312
原创 Unique-paths
题目描述A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the ...
2018-06-24 18:59:52
197
原创 Search-a-2d-matrix
题目描述Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each row...
2018-06-24 17:31:48
206
原创 Binary-tree-preorder-traversal
题目描述Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Note: Recursive solution is trivial, could...
2018-06-23 11:52:30
205
原创 Merge-two-sorted-lists
题目描述Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./** * Definition for singly-linked list. * public cla...
2018-06-23 10:55:42
339
原创 Generate-parentheses
题目描述Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()"i...
2018-06-23 10:06:53
256
原创 Binary-tree-inorder-traversal
题目描述Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].Note: Recursive solution is trivial, could ...
2018-06-22 16:07:12
265
原创 Balanced-binary-tree
题目描述Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe...
2018-06-22 15:27:26
256
原创 Same-tree
题目描述Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value./** * Definit...
2018-06-22 14:23:11
268
原创 重温CCNA(十三)
1.OSPF 的功能OSPF 的功能如图 1 所示,包括:无类 - OSPFv2 设计为无类方式;因此,它可支持 IPv4 VLSM 和 CIDR。高效 - 路由变化会触发路由更新(非定期更新)。它使用 SPF 算法选择最优路径。快速收敛 - 它能迅速地传播网络变化。可扩展 - 在小型和大型网络中都能够良好运行。路由器可以分为多个区域,以支持分层结构。安全 - OSPFv2 支持消息摘要 5 (M...
2018-06-21 21:39:16
342
原创 Climbing-stairs
题目描述You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?public class Solution { publ...
2018-06-21 20:55:01
575
原创 Rotate-image
题目描述You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?public class Solution { public void rotate(int[][] matrix...
2018-06-21 20:40:42
220
原创 Unique-binary-search-trees
题目描述Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1 \ ...
2018-06-21 19:45:00
206
转载 Roman-to-integer
题目描述Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.code:public class Solution { public int romanToInt(String s) { Map<Charact...
2018-06-20 21:39:53
217
原创 Search-insert-position
题目描述Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array....
2018-06-20 20:56:06
297
原创 Maximum-subarray
题目描述Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2,1,−5,4],the contiguous subarray[4,−1,2,1]has the...
2018-06-20 20:20:07
244
原创 Best-time-to-buy-and-sell-stock
题目描述Say you have an array for which the i th element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock)...
2018-06-20 19:49:06
229
原创 Populating-next-right-pointers-in-each-node
题目描述Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right node. If the...
2018-06-20 15:13:41
259
原创 重温CCNA(十二)
1.管理距离 2.EIGRP的复合度量3.https://www.netacad.com/static-course-assets/ScaN6/zh/index.html#6.3.3.64.DUAL 有限状态机 (FSM)EIGRP 的核心就是 DUAL 以及 DUAL 的 EIGRP 路由计算引擎。此技术的确切名称为 DUAL 有限状态机 (FSM)。FSM 包含用于在 EIGRP 网络中计算和...
2018-06-19 21:30:29
435
转载 Palindrome-number
题目描述Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of converting the in...
2018-06-19 19:47:09
218
原创 Linked-list-cycle
题目描述Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?code:/** * Definition for singly-linked list. * class ListNode { * int val; * ...
2018-06-19 18:32:40
147
原创 Integer-to-roman
题目描述Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.code:public class Solution { public String intToRoman(int num) { int[] number...
2018-06-19 17:19:58
224
原创 Container-with-most-water
题目描述Given n non-negative integers a1 , a2 , ..., an , where each represents a point at coordinate (i, ai ). n vertical lines are drawn such that the two endpoints of line i is at (i, ai ) and (i, 0). ...
2018-06-19 16:56:14
283
原创 Best-time-to-buy-and-sell-stock-ii
题目描述Say you have an array for which the i th element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy o...
2018-06-19 08:15:27
214
原创 Reverse-integer
题目描述Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are some good questions to ask before coding. Bonus...
2018-06-19 08:01:42
209
原创 Single-number
题目描述Given an array of integers, every element appears twice except for one. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extr...
2018-06-18 17:37:12
218
原创 Maximum-Depth-of-Binary-Tree
题目描述Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.代码:public class Solution { public...
2018-06-18 17:23:09
195
原创 牛客网小白大赛(一)
链接:https://www.nowcoder.com/acm/contest/134/F来源:牛客网题目描述 一串长度为 n 的字符串 A 和一串长度为 m 的字符串 B。并且这两串字符串只会含有 0 或 1 。 铁子可以对字符串 A 执行两种操作,两种操作可以执行任意次。 操作1(无情替换):铁子可以用 11 替换掉 0 ,也可以用 00 替换掉 1 . ...
2018-06-17 23:37:14
306
原创 Ryu控制器实现流量监控
from operator import attrgetterfrom ryu.app import simple_switch_13from ryu.controller import ofp_eventfrom ryu.controller.handler import MAIN_DISPATCHER, DEAD_DISPATCHERfrom ryu.controller.handl...
2018-06-17 12:32:34
4184
原创 Ryu控制器实现自学习交换机功能
代码如下:from ryu.base import app_managerfrom ryu.controller import ofp_eventfrom ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHERfrom ryu.controller.handler import set_ev_clsfrom ryu....
2018-06-15 16:01:14
2492
原创 Ryu控制器实现hub功能
from ryu.base import app_managerfrom ryu.ofproto import ofproto_v1_3from ryu.controller import ofp_eventfrom ryu.controller.handler import MAIN_DISPATCHER,CONFIG_DISPATCHERfrom ryu.controller.hand...
2018-06-15 14:04:13
1152
原创 数据库系统原理期末复习
一.填空选择题1.数据库系统的特点是(数据共享 )、数据独立、减少数据冗余、避免数据不一致和加强了数据保护2.在数据库中,产生数据不一致的根本原因是(数据冗余)3.数据模型是由数据结构,数据操作,数据约束组成的4.数据库系统是指在计算机系统中引入数据库后的系统,一般由数据库,数据库管理系统,应用程序,数据库管理人员组成5.数据结构是对数据系统的静态特性的描述, 数据操作是对数据库系统的动态特性的描...
2018-06-12 00:53:49
4278
原创 大学数据库考试范围(带例题)
一.题型:1.单项选择题(10个,10分)2.填空题(10个空,20分)3.简答题(4题,20分)4.E-R图操作题(3题,15分)5.综合题(13题,35分)二.示例3. 简答题(1)什么是数据模型,数据模型的三要素是什么? 数据模型是严格定义的一组概念的集合,这些概念精确地描述了系统的静态特性 动态特性和完整性约束条件。 数据结构 数据操作 完整性约束(2)数据库管理系统的功能 ...
2018-06-11 21:40:56
6767
1
原创 如何获取emp_v和employees有相同的数据no
题目描述存在如下的视图:create view emp_v as select * from employees where emp_no >10005;如何获取emp_v和employees有相同的数据?CREATE TABLE `employees` (`emp_no` int(11) NOT NULL,`birth_date` date NOT NULL,`first_name` va...
2018-06-11 10:19:34
802
算法设计指南
2019-02-19
高数下册.md
2019-06-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人