算法题刷题笔记-链表
算法题刷题笔记-链表1. 相交链表(LC160)123456789101112131415# Definition for singly-linked list.# class ListNode:# def __init__(self, x):# self.val = x# self.next = Noneclass Solution: def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> Optional[ListNode]: A = headA B = headB while A != B: A = A.next if A else headB B = B.next if B else headA return A
链表基本操作
2. 反转链表(LC206)123456789101112131415# Definition for s ...
Python手撕常用模版
Python手撕常用模版标准输出123456789101112131415161718192021a = 10# 输出:10print(a)# 串联输出(通过字符串拼接或逗号分隔)# 输出:Hello, World!print("Hello" + ", " + "World!")# 使用 sep 指定分隔符print("Hello", "World!", sep=", ")s = "abc"# 输出:abc 10print(s, a)# 格式化输出# 输出:abc 10print(f"{s} {a}")# print默认会添加末尾换行符,可使用end=""来消除print(f"{s} {a}", end = "")
标准输入(ACM模式)
一般读入(stdin/input)1234 ...
算法题刷题笔记-数组
算法题刷题笔记-数组1. 最大子数组和 (LC53)12345class Solution: def maxSubArray(self, nums: List[int]) -> int: for i in range(1, len(nums)): nums[i] += max(nums[i - 1], 0) return max(nums)
类似前缀和解法,也可以说是动归
保持连续的一段子数组正增长。
第i项等于第i-1项与第i项的和。一旦出现负数,则说明出现了负增长,旧子数组的累加停止,重新开始累加。
2. 合并区间 (LC56)123456789101112class Solution: def merge(self, intervals: List[List[int]]) -> List[List[int]]: intervals.sort(key=lambda x: x[0]) merged = [] for interval in intervals: ...
Paper Reading - Summary of some practical children-related HCI works
Summary of some practical children-related HCI worksTACTORBOTSWHAT
TactorBots, which is used to explore emotional robotic touch outside the lab
to complete ’expressive haptic storytelling’ to test the function
HOW
toolkit
semi- structured interview
open-ended questions
Tangible Immersive Trauma SimulationWHAT
Mixed Reality (MR) in medical skills training
superimposing virtual avatars on physical modals of human body, enables trainees to interact haptically and tangibly with the injured i ...
Paper Reading - LaCir: A Multilayered Laser-cuttable Material to Co-fabricate Circuitry and Structural Components
LaCir: A Multilayered Laser-cuttable Material to Co-fabricate Circuitry and Structural ComponentsAuthorNiels Christian Buch, Carlos E. Tejada, Daniel Ashbrook, Valkyrie Savage, CHI 2024
KeywordsPrototyping; Digital Fabrication; Circuitry; Laser Cutter; Multi- material Stack; Circuit Joinery
WHAT
A method for using sandwiched material consisting of two structural and one conductive layer to prototype electrically functional objects on a laser cutter
An exploration and evaluation of the character ...
算法题刷题笔记-哈希
算法题刷题笔记-哈希1. 两数之和(LC1)12345678class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: hashtable = dict() for i,num in enumerate(nums): if target - num in hashtable: return [hashtable[target-num], i] hashtable[nums[i]] = i return []
因为返回数组下标,所以建立哈希表(字典)时以值为索引,以索引为值
求目标数target减去当前数num是否在哈希字典中
2. 最长连续序列(LC128)12345678910111213141516class Solution: def longestConsecutive(self, nums: List[int]) -> int: ...
Paper Reading - Using Low-frequency Sound to Create Non-contact Sensations On and In the Body
Using Low-frequency Sound to Create Non-contact Sensations On and In the BodyAuthorWaseem Hassan, Asier Marzo, Kasper Hornbæk, CHI 2024
KeywordsVibrotactile Feedback; Midair, Non-contact Haptics; Psychophysics; Low Frequency Sounds; Room Modes
WHAT
explores the perceptual effects ofthese low-frequency sounds and investigates the potential of this method for delivering whole-body sensations
WHY
The use of low-frequency sounds for delivering sensations has not yet been explored in the field of HC ...
Paper Reading - Sensing Hand Interactions with Everyday Objects by Profiling Wrist Topography
Sensing Hand Interactions with Everyday Objects by Profiling Wrist TopographyAuthorJulius Cosmo Romeo Rudolph, David Holman, Bruno De Araujo, Ricardo Jota, Daniel Wigdor, Valkyrie Savage, TEI 2022
KeywordsWrist Topography, Capacitive Sensing, Wristband, Everyday Objects, Affordances
WHAT
examine how we can further increase contextual awareness about user activities and their environment
WHY
the intersection of wrist-worn sensing and interaction with objects in ubiquitous environments.
HOW
infe ...
Paper Reading - A Dataset of Alt Texts from HCI Publications
A Dataset of Alt Texts from HCI PublicationsAuthorSanjana Chintalapati, Jonathan Bragg, Lucy Lu Wang, ASSETS 2022
KeywordsAccessibility, Scientifc Documents, Alt Text, Dataset
WHAT
An assessment of the semantic information conveyed by author-written alt text of graph and chart fgures extracted from papers
A dataset of 3386 author-written alt text from HCI publications, of which 547 have been annotated with semantic levels
WHY
graphs and charts are of special importance to these users
the vas ...
NLP复习-BERT基础
BERT基础