自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 收藏
  • 关注

原创 剑指offer题解 Python Solution

@TOC1.二维数组中的查找题目描述在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。解法:class Solution: def Find(self, target, array): if not array: ...

2019-10-22 14:09:36 1944

原创 LeetCode *92. Reverse Linked List II (Python Solution)

题目描述Reverse a linked list from position m to n. Do it in one-pass.Note: 1 ≤ m ≤ n ≤ length of list.将位置m的链接列表反转到n。 只遍历一次。注意:1≤m≤n≤列表长度。Example 1:Input: 1->2->3->4->5->NULL, m = 2,...

2019-09-03 16:54:14 149

原创 LeetCode *328. Odd Even Linked List (Python Solution)

题目描述Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You should try to do it ...

2019-09-03 13:41:30 133

原创 LeetCode *24. Swap Nodes in Pairs (Python Solution)

题目描述Given a linked list, swap every two adjacent nodes and return its head.You may not modify the values in the list’s nodes, only nodes itself may be changed.给定链表,交换每两个相邻结点并返回其头部。您可能无法修改列表结点中的值,只...

2019-09-03 11:39:17 134

原创 LeetCode *206. Reverse Linked List (Python Solution)

题目描述Reverse a singly linked list.反转一个单链表Example 1:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLPython Solution分析: 反转链表是链表操作里比较经典的题型,操作为用一个单链表储存新的反转后的链表,原...

2019-08-19 12:41:11 191

原创 LeetCode *80. Remove Duplicates from Sorted Array II (Python Solution)

题目描述Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.Do not allocate extra space for another array, you must do this by...

2019-08-16 17:43:01 82

原创 LeetCode *26. Remove Duplicates from Sorted Array (Python Solution)

题目描述Given a sorted array nums, 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 by mod...

2019-08-16 17:03:18 126

原创 LeetCode *27. Remove Element (Python Solution)

题目描述Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input ...

2019-08-16 16:36:58 120

原创 LuusNyAaKv

2019-08-16 15:50:48 86

原创 LeetCode *876. Middle of the Linked List (Python Solution)

题目描述Given a non-empty, singly linked list with head node head, return a middle node of linked list.If there are two middle nodes, return the second middle node.给定具有头节点头的非空的单链表,返回链表的中间节点。如果有两个中间节点,...

2019-08-09 15:40:19 153

原创 LeetCode *203.Remove Linked List Elements (Python Solution)

题目描述Remove all elements from a linked list of integers that have value val.从链表中删除所有值等于 val 的结点ExampleInput: 1->2->6->3->4->5->6, val = 6Output: 1->2->3->4->5Pytho...

2019-08-09 14:51:09 161

原创 LeetCode *100. Same Tree (Python Solution)

题目描述Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same value.给定两个二...

2019-08-08 17:12:28 150

原创 LeetCode *19. Remove Nth Node From End of List (Python Solution)

题目描述Given a linked list, remove the n-th node from the end of list and return its head.给定一个链表,从列表末尾删除第n个节点并返回其头指针。Example 1:Input: 1Output: trueExplanation: 20 = 1Example 2:Input: 16Output...

2019-08-08 15:30:31 109

原创 LeetCode *226.Invert Binary Tree (Python Solution)

题目描述Invert a binary tree.操作给定的二叉树,将其变换为源二叉树的镜像。二叉树的镜像定义:源二叉树 8 / \ 6 10 / \ / \ 5 7 9 11 镜像二叉树 8 / \ 10 6 / \ / \ ...

2019-08-08 15:17:43 140

原创 剑指offer *链表中倒数第k个结点(Python Solution)

题目描述Enter a linked list and output the kth node from the bottom of the list.输入一个链表,输出该链表中倒数第k个结点。Python Solution分析: 利用快慢指针,快指针先走 k 步,慢指针再走,一直到快指针到头。两者保持距离为 k ,但由于最后一次快指针到头了,慢指针仍然走了一位,所以两者相距 (k - ...

2019-08-07 00:22:08 133

原创 LeetCode *342.Power of Four (Python Solution)

题目描述Given an integer (signed 32 bits), write a function to check whether it is a power of 4.给定一个整数(带符号的32位),写一个函数来检查它是否为4的幂。Example 1:Input: 16Output: trueExample 2:Input: 5Output: false...

2019-08-03 00:34:38 114

原创 LeetCode *231.Power of Two (Python Solution)

题目描述Given an integer, write a function to determine if it is a power of two.给定一个整数,写一个函数来确定它是否是2的幂。Example 1:Input: 1Output: trueExplanation: 20 = 1Example 2:Input: 16Output: trueExplanat...

2019-08-02 14:54:42 221

原创 hostapd中beacon流程

hostapd中beacon流程ieee802_11_build_ap_params()- ieee802_11_set_beacon()-- ieee802_11_set_beacons()--- handle_assoc()--- hostapd_2040_coex_action()--- hostapd_intolerant_add()--- update_ht_state()--- ap_...

2019-08-01 18:51:59 1755

原创 LeetCode *20.Valid Parentheses (Python Solution)

问题描述Valid Parentheses Leetcode20Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:1.Open brackets mu...

2019-07-25 18:15:44 157

原创 LeetCode *1.Two Sum (Python Solution)

问题描述Two Sum 原题链接Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may ...

2019-07-22 10:01:22 134

原创 OS. *1 .进程与线程

##基础概念1.进程进程是资源分配的基本单位。进程控制块 (Process Control Block, PCB) 描述进程的基本信息和运行状态,所谓的创建进程和撤销进程,都是指对 PCB 的操作。2.线程线程是独立调度的基本单位。一个进程中可以有多个线程,它们共享进程资源。QQ 和浏览器是两个进程,浏览器进程里面有很多线程,例如 HTTP 请求线程、事件响应线程、渲染线程等...

2019-07-19 11:22:57 144

转载 Python Interview.

Table of ContentsPython语言特性1 Python的函数参数传递2 Python中的元类(metaclass)3 @staticmethod和@classmethod4 类变量和实例变量5 Python自省6 字典推导式7 Python中单下划线和双下划线8 字符串格式化:\x和.format9 迭代器和生成器10 *args and **kwarg...

2019-07-13 00:05:38 533

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除