摘要:
题意:去掉给定头ListNode* head 的单链表内 val 等于一个 给定val的节点并返回头 思路:此题删除链表中元素是很简单的,只需要让待删节点之前一个节点指向待删节点之后一个节点即可。 此题最大的问题就是,题目要求我们要返回新链表中的头结点,如果我们就采用仅仅复制头结点的方式(用H=he 阅读全文
摘要:
199. Binary Tree Right Side View Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes yo 阅读全文
摘要:
numCourses->总的课程数目 Prerequisited->pair in a list denoting have to finish b to study a class Solution: def canFinish(self, numCourses: int, prerequisit 阅读全文
摘要:
!!Given the head of a linked list, rotate the list to the right by k places.!! # Definition for singly-linked list. # class ListNode(object): # def __ 阅读全文
摘要:
1. Write the co-occurrence matrix {\rm X}X for this sentence, using a 4-word context window (i.e. two context words on either side of the central word 阅读全文
摘要:
数据缺失分为两种:一是行记录的缺失;二是列值的缺失。 不同的数据存储和环境中对于缺失值的表示不同,例如数据库中是Null、Python返回对象是None、Pandas或Numpy中是NaN。 #导入相关库import pandas as pd import numpy as np #random d 阅读全文