当前位置: 首页 > news >正文

HippoRAG 2 原理精读

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录

    • 整体流程
      • 离线索引阶段
      • 在线检索和问答阶段
    • 总结

整体流程

在这里插入图片描述

从上图可以看出,整个流程分为两个阶段

1、离线索引阶段

2、在线检索和问答阶段

离线索引阶段

1、对文档进行分段
2、抽取实体

对应的prompt

ner_system = """Your task is to extract named entities from the given paragraph. 
Respond with a JSON list of entities.
"""one_shot_ner_paragraph = """Radio City
Radio City is India's first private FM radio station and was started on 3 July 2001.
It plays Hindi, English and regional songs.
Radio City recently forayed into New Media in May 2008 with the launch of a music portal - PlanetRadiocity.com that offers music related news, videos, songs, and other music-related features."""one_shot_ner_output = """{"named_entities":["Radio City", "India", "3 July 2001", "Hindi", "English", "May 2008", "PlanetRadiocity.com"]
}
"""prompt_template = [{"role": "system", "content": ner_system},{"role": "user", "content": one_shot_ner_paragraph},{"role": "assistant", "content": one_shot_ner_output},{"role": "user", "content": "${passage}"}
]

LLM的输出如

{"named_entities": ["迦楼罗","大鹏金翅鸟","岳飞"]
}

3、根据实体和文本生成三元组

from .ner import one_shot_ner_paragraph, one_shot_ner_output
from ...utils.llm_utils import convert_format_to_templatener_conditioned_re_system = """Your task is to construct an RDF (Resource Description Framework) graph from the given passages and named entity lists. 
Respond with a JSON list of triples, with each triple representing a relationship in the RDF graph. Pay attention to the following requirements:
- Each triple should contain at least one, but preferably two, of the named entities in the list for each passage.
- Clearly resolve pronouns to their specific names to maintain clarity."""ner_conditioned_re_frame = """Convert the paragraph into a JSON dict, it has a named entity list and a triple list.
Paragraph:

{passage}


{named_entity_json}
"""ner_conditioned_re_input = ner_conditioned_re_frame.format(passage=one_shot_ner_paragraph, named_entity_json=one_shot_ner_output)ner_conditioned_re_output = """{"triples": [["Radio City", "located in", "India"],["Radio City", "is", "private FM radio station"],["Radio City", "started on", "3 July 2001"],["Radio City", "plays songs in", "Hindi"],["Radio City", "plays songs in", "English"],["Radio City", "forayed into", "New Media"],["Radio City", "launched", "PlanetRadiocity.com"],["PlanetRadiocity.com", "launched in", "May 2008"],["PlanetRadiocity.com", "is", "music portal"],["PlanetRadiocity.com", "offers", "news"],["PlanetRadiocity.com", "offers", "videos"],["PlanetRadiocity.com", "offers", "songs"]]
}
"""prompt_template = [{"role": "system", "content": ner_conditioned_re_system},{"role": "user", "content": ner_conditioned_re_input},{"role": "assistant", "content": ner_conditioned_re_output},{"role": "user", "content": convert_format_to_template(original_string=ner_conditioned_re_frame, placeholder_mapping=None, static_values=None)}
]

这一步会根据上面抽取出来的实体、原始文本内容生成三元组。

格式如:[主语, 谓语, 宾语]

4、对原始文本、三元组、实体进行向量化

使用的是 nvidia/NV-Embed-v2 模型,参数量为7B

对不同类型的数据,使用的prompt不同,如下:

instructions = {'ner_to_node': 'Given a phrase, retrieve synonymous or relevant phrases that best match this phrase.','query_to_node': 'Given a question, retrieve relevant phrases that are mentioned in this question.','query_to_fact': 'Given a question, retrieve relevant triplet facts that matches this question.','query_to_sentence': 'Given a question, retrieve relevant sentences that best answer the question.','query_to_passage': 'Given a question, retrieve relevant documents that best answer the question.',
}

5、增加同义词边

连接语义相近的实体

在线检索和问答阶段

1、检索topn 的三元组,用LLM对检索结果过滤无关三元组
* 如果没有检索到三元组,则直接检索相关文档
* 如果检索到三元组,则从构建的图中基于个性化的pagerank算法,检索出topn的相关文档

2、利用LLM基于检索结果回答

对应prompt

one_shot_ircot_demo_docs = ("""Wikipedia Title: Milk and Honey (album)\nMilk and Honey is an album by John Lennon and Yoko Ono released in 1984. Following the compilation "The John Lennon Collection", it is Lennon's eighth and final studio album, and the first posthumous release of new Lennon music, having been recorded in the last months of his life during and following the sessions for their 1980 album "Double Fantasy". It was assembled by Yoko Ono in association with the Geffen label.\n\n""""""Wikipedia Title: John Lennon Museum\nJohn Lennon Museum (ジョン・レノン・ミュージアム , Jon Renon Myūjiamu ) was a museum located inside the Saitama Super Arena in Chūō-ku, Saitama, Saitama Prefecture, Japan. It was established to preserve knowledge of John Lennon's life and musical career. It displayed Lennon's widow Yoko Ono's collection of his memorabilia as well as other displays. The museum opened on October 9, 2000, the 60th anniversary of Lennon’s birth, and closed on September 30, 2010, when its exhibit contract with Yoko Ono expired. A tour of the museum began with a welcoming message and short film narrated by Yoko Ono (in Japanese with English headphones available), and ended at an avant-garde styled "reflection room" full of chairs facing a slide show of moving words and images. After this room there was a gift shop with John Lennon memorabilia available.\n\n""""""Wikipedia Title: Walls and Bridges\nWalls and Bridges is the fifth studio album by English musician John Lennon. It was issued by Apple Records on 26 September 1974 in the United States and on 4 October in the United Kingdom. Written, recorded and released during his 18-month separation from Yoko Ono, the album captured Lennon in the midst of his "Lost Weekend". "Walls and Bridges" was an American "Billboard" number-one album and featured two hit singles, "Whatever Gets You thru the Night" and "#9 Dream". The first of these was Lennon's first number-one hit in the United States as a solo artist, and his only chart-topping single in either the US or Britain during his lifetime.\n\n""""""Wikipedia Title: Nobody Loves You (When You're Down and Out)\n"Nobody Loves You (When You're Down and Out)" is a song written by John Lennon released on his 1974 album "Walls and Bridges". The song is included on the 1986 compilation "Menlove Ave.", the 1990 boxset "Lennon", the 1998 boxset "John Lennon Anthology", the 2005 two-disc compilation "", and the 2010 boxset "Gimme Some Truth".\n\n""""""Wikipedia Title: Give Peace a Chance\n"Give Peace a Chance" is an anti-war song written by John Lennon (credited to Lennon–McCartney), and performed with Yoko Ono in Montreal, Quebec, Canada. Released as a single in 1969 by the Plastic Ono Band on Apple Records (catalogue Apple 13 in the United Kingdom, Apple 1809 in the United States), it is the first solo single issued by Lennon, released when he was still a member of the Beatles, and became an anthem of the American anti-war movement during the 1970s. It peaked at number 14 on the "Billboard" Hot 100 and number 2 on the British singles chart.\n"""
)one_shot_ircot_demo = (f'{one_shot_ircot_demo_docs}''\n\nQuestion: 'f"Nobody Loves You was written by John Lennon and released on what album that was issued by Apple Records, and was written, recorded, and released during his 18 month separation from Yoko Ono?"'\nThought: 'f"The album issued by Apple Records, and written, recorded, and released during John Lennon's 18 month separation from Yoko Ono is Walls and Bridges. Nobody Loves You was written by John Lennon on Walls and Bridges album. So the answer is: Walls and Bridges."'\n\n'
)ircot_system = ('You serve as an intelligent assistant, adept at facilitating users through complex, multi-hop reasoning across multiple documents. This task is illustrated through demonstrations, each consisting of a document set paired with a relevant question and its multi-hop reasoning thoughts. Your task is to generate one thought for current step, DON\'T generate the whole thoughts at once! If you reach what you believe to be the final step, start with "So the answer is:".''\n\n'f'{one_shot_ircot_demo}'
)prompt_template = [{"role": "system", "content": ircot_system},{"role": "user", "content": "${prompt_user}"}
]

总结

1、只是用三元组来协助检索,并没有利用图
2、难以相信这种做法能超越普通RAG几十个点

参考:

HippoRAG 2: From RAGtoMemory: Non-Parametric Continual Learning for Large Language Models

相关文章:

HippoRAG 2 原理精读

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 整体流程离线索引阶段在线检索和问答阶段 总结 整体流程 从上图可以看出,整个流程分为两个阶段 1、离线索引阶段 2、在线检索和问答阶段 离线索引阶段…...

HTTPS协议原理:在Linux世界里的加密冒险

大家好,欢迎来到这次奇妙的HTTPS协议探险之旅!今天,我们将一起潜入Linux的深处,揭开HTTPS协议那神秘而迷人的面纱。别担心,即使你是技术小白,也能在这场冒险中找到乐趣和收获。想象一下,你是一位…...

Spring Boot启动流程及源码实现深度解析

Spring Boot启动流程及源码实现深度解析 一、启动流程概述 Spring Boot的启动流程围绕SpringApplication类展开,核心流程可分为以下几个阶段: 初始化阶段:推断应用类型,加载ApplicationContextInitializer和ApplicationListene…...

使用pip在Windows机器上安装Open Webui,配合Ollama调用本地大模型

之前的文章分享过在 linux 服务器上安装,并使用Open-webui 来实现从页面上访问本地大模型的访问。也写了文章分享了我在家里 Windows Server 台式机上安装 Ollama 部署本地大模型,并分别使用 Chatbox 和 CherryStudio 来访问本地的大模型。今天我来分享一…...

go map的声明和使用

1.简介 map是key-value数据结构,又称为字段或者关联数据。类似其他语言的集合,map在go中是引用类型,必须初始化才能使用。 2.语法 map[keytype]valuetype keytype:表示间的类型。可以是基本数据类型,还可以是指针、channl等。…...

word毕业论文“et al.”替换为“等”——宏

Sub 中文参考文献改等()中文参考文献改等 宏Selection.Find.ClearFormattingSelection.Find.Replacement.ClearFormattingWith Selection.Find.Text "([一-龥], )et al.".Replacement.Text "\1等.".Forward True.Wrap wdFindContinue.Format False.Ma…...

23. 观察者模式

原文地址: 观察者模式 更多内容请关注:智想天开 1. 观察者模式简介 观察者模式(Observer Pattern)是一种行为型设计模式,用于建立对象之间的一种一对多的依赖关系。当一个对象的状态发生变化时,所有依赖于它的对象都…...

go的”ambiguous import in multiple modules”

执行“go mod tidy”报如下错误: go mod tidy -compat1.17 go: finding module for package github.com/gomooon/goredis go: found github.com/gomooon/goredis in github.com/gomooon/goredis v0.3.5 go: github.com/gomooon/core importsgithub.com/gomooon/gor…...

【鸿蒙开发】MongoDB入门

https://www.mongodb.com/try/download/community 下载MongoDB: var mongoose require("mongoose");// localhost 域名,代表本机 // 127.0.0.1 ip , 代码本机 mongoose.connect("mongodb://localhost:27017/jiaju").then(() > {console.l…...

【应用篇】MLU上deepseek/QwQ-32B+dify实现workflow应用

文章目录 前言一、平台环境选择二、创建容器应用三、启动服务1.下载deepseekR1-14B模型2.VLLM启动服务3.postman测试服务 四、workflow搭建1.搭建第一个工作流2.详细配置 五、效果演示 前言 本章主要讲解如何用paas平台,实现智能体应用 本章中大模型我们使用deeps…...

vue组件库el-menu导航菜单设置index,地址不会变更的问题

请先确认 1.路由已配置好 route-index.js如下, 2.view-ProHome.vue中已预留路由展示位 3.导航菜单复制组件库,并做修改 其中index与路由配置的地址一致 运行后发现点击菜单,url地址还是不变,查看组件库 Element - The worlds …...

防抖和节流

防抖(Debounce)和节流(Throttle)是前端开发中常用的两种性能优化技术,主要用于控制高频事件的触发频率,避免不必要的性能消耗。 1. 防抖(Debounce) 防抖的核心思想:在事…...

Deepseek可以通过多种方式帮助CAD加速工作

自动化操作:通过Deepseek的AI能力,可以编写脚本来自动化重复性任务。例如,使用Python脚本调用Deepseek API,在CAD中实现自动化操作。 插件开发:结合Deepseek进行二次开发,可以创建自定义的CAD插件。例如&a…...

基于Spring Boot的宠物猫认养系统的设计与实现(LW+源码+讲解)

专注于大学生项目实战开发,讲解,毕业答疑辅导,欢迎高校老师/同行前辈交流合作✌。 技术范围:SpringBoot、Vue、SSM、HLMT、小程序、Jsp、PHP、Nodejs、Python、爬虫、数据可视化、安卓app、大数据、物联网、机器学习等设计与开发。 主要内容:…...

开源!速度100Kb/s的有线和无线双模ESP32S3芯片的DAP-Link调试器

开源!速度100Kb/s的有线和无线双模ESP32S3芯片的DAP-Link调试器 目录 开源!速度100Kb/s的有线和无线双模ESP32S3芯片的DAP-Link调试器本项目未经授权,禁止商用!本项目未经授权,禁止商用!本项目未经授权&…...

Vue3 模板引用:打破数据驱动的次元壁(附高阶玩法)

在数据驱动的Vue世界中,模板引用(Template Refs)是我们与真实DOM对话的秘密通道。本文将带你深入理解这个"逃生舱"的正确打开方式,并分享实战中的高阶技巧。 一、基础入门:建立DOM连接 1. 创建模板引用 &…...

第五天 Labview数据记录(5.5 SQL数据库读写)

5.5 SQL数据库读写 SQL 数据库读写操作是现代软件开发、数据分析和企业信息系统的核心功能。其意义不仅体现在技术层面,还涉及到业务流程优化、数据管理、决策支持等多个方面。以下是 SQL 数据库读写操作的重要意义:1. 数据存储与管理;2. 支…...

微信小程序项目引入图片问题:Error: module ‘assets/img/topImg.jpg.js‘ is not defined

问题与处理策略 问题描述 在微信小程序项目中,通过 require 引入图片文件,报如下错误 Error: module assets/img/topImg.jpg.js is not defined, require args is ../../assets/img/topImg.jpg# 翻译错误:未定义模块“assets/img/topImg.…...

02C#基本结构篇(D4_注释-访问修饰符-标识符-关键字-运算符-流程控制语句)

目录 一、注释 1. 单行注释 2. 多行注释 3. XML文档注释 4. 使用建议和最佳实践: 二、访问修饰符 1. public 2. private 3. protected 4. internal 5. protected internal 或 protected and internal 6. private protected 或 private and protected 7.…...

Python:正则表达式

正则表达式的基础和应用 一、正则表达式核心语法(四大基石) 1. ​元字符(特殊符号)​ ​定位符 ^:匹配字符串开始位置 $:匹配字符串结束位置 \b:匹配单词边界​(如 \bword\b 匹配…...

ChatGPT4.5详细介绍和API调用详细教程

OpenAI在2月27日发布GPT-4.5的研究预览版——这是迄今为止OpenAI最强大、最出色的聊天模型。GPT-4.5在扩大预训练和微调规模方面迈出了重要的一步。通过扩大无监督学习的规模,GPT-4.5提升了识别内容中的模式、建立内容关联和生成对于内容的见解的能力,但…...

linux makefile tutorial

一个makefile的教程,几个小时就能看完,对makefile有个总体加细节的系统了解,非常不错: Learn Makefiles With the tastiest examples 中文翻译版: 起步 - Makefile 教程 (gavinliu6.github.io) gcc官网手册&#x…...

学习C2CRS Ⅲ (Response Generation Module)

代码地址:https://github.com/RUCAIBox/WSDM2022-C2CRS 论文地址:https://arxiv.org/abs/2201.02732 CFSelectionConvModel模型结构与功能 CFSelectionConvModel 是一个用于对话推荐系统的端到端模型,结合了知识图谱(KG)、评论信息和对话上下文来生成对话响应。它通过以…...

SpringBoot全栈开发:从数据库到Markdown文件导出的终极实践指南

一、SpringBoot后端核心实现 1.1 数据库数据转MD文件 通过SpringBoot实现数据库内容导出为Markdown文件,是文档自动化生成的关键技术: GetMapping("/download") public void exportMd(HttpServletResponse response, Integer id) {Content …...

go函数详解

1.简介 函数是组织好的、可重复使用的,用于执行指定任务的代码块,为了完成某一个功能的程序指令的集合,称为函数。go语言中支持:函数、匿名函数和闭包。 2.函数的定义 func 函数名 (形参列表) (返回值列表){ 函数体 return …...

MVCC实现原理

一、引言 在现代数据库管理系统中,数据的一致性和并发性是两个至关重要的特性。传统的锁机制虽然有效,但也存在着性能瓶颈,特别是在高并发环境下,锁的争用会导致系统响应时间变慢,甚至引发死锁等问题。为了克服这些挑…...

通过Golang的container/list实现LRU缓存算法

文章目录 力扣:146. LRU 缓存主要结构 List 和 Element常用方法1. 初始化链表2. 插入元素3. 删除元素4. 遍历链表5. 获取链表长度使用场景注意事项 源代码阅读 在 Go 语言中,container/list 包提供了一个双向链表的实现。链表是一种常见的数据结构&#…...

网络编程7天学java

* 网络编程:两台或两台以上的主机构成一个网络 * IP地址:标志网络中的一个通信实体的地址 * 端口号:区分不同应用程序 * 网络通信协议:ISO参考模型(7层),TCP/IP协议(4层)…...

在 IntelliJ IDEA 中配置 Git

1. 确保已安装 Git 在配置之前,确保你的系统已经安装了 Git。 检查是否已安装 Git: bash 复制 git --version 如果未安装,请前往 Git 官网 下载并安装。 2. 在 IntelliJ IDEA 中配置 Git 打开 IntelliJ IDEA。 进入设置: Windo…...

【Godot4.4】Rect2总结

概述 Rect2是2D场景中比较重要的一种数据类型。 Rect2的本质含义是2D场景的轴对齐包围盒,而不是可以自由变换的矩形。 Rect2提供了一些方法,可以方便的判断Rect2之间是否重叠、包含等,并可以获得重叠的区域。也可以获得两个Rect2的包围盒。…...

git使用命令总结

文章目录 Git 复制创建提交步骤Git 全局设置:创建 git 仓库:已有仓库? 遇到问题解决办法:问题一先git pull一下,具体流程为以下几步: 详细步骤 Git 复制 git clone -b RobotModelSetting/develop https://gitlab.123/PROJECT/123.git创建提…...

Unity DOTS从入门到精通之 C# Job System

文章目录 前言安装 DOTS 包C# 任务系统Mono 环境DOTS 环境运行作业NativeContainer 前言 作为 DOTS 教程,我们将创建一个旋转立方体的简单程序,并将传统的 Unity 设计转换为 DOTS 设计。 Unity 2022.3.52f1Entities 1.3.10 安装 DOTS 包 要安装 DOTS…...

linux下的网络抓包(tcpdump)介绍

linux下的网络抓包[tcpdump]介绍 前言tcpdump1. 安装 tcpdump2. 基本抓包命令3. 过滤器使用4. 保存捕获的数据包 异常指标1. 连接建立与断开相关指标异常 SYN 包异常 FIN 或 RST 包 2. 流量相关指标异常流量峰值异常源或目的 IP 流量 3. 端口相关指标异常端口使用端口扫描 4. 数…...

深入理解 Linux 中的 -h 选项:让命令输出更“人性化”

在 Linux 系统中,命令行工具是系统管理员和普通用户最常用的交互方式之一。然而,命令行输出往往充满了技术性术语和数字,对于初学者或非技术用户来说可能显得晦涩难懂。幸运的是,许多 Linux 命令都提供了一个非常实用的选项&#…...

selenium的鼠标操作

1、鼠标操作 鼠标时间对应的方法在那个类中? ​ ActionChains类,实例化 鼠标对象 1、context_click(element) # 右击 2、double_click(element) #双击 3、double_and_drop(source, target) # 拖拽 4、move_to_element(element) # 悬停 【重点】 5、perform() …...

STM32——GPIO介绍

GPIO(General-Purpose IO ports,通用输入/输出接口)模块是STM32的外设接口的核心部分,用于感知外界信号(输入模式)和控制外部设备(输出模式),支持多种工作模式和配置选项。 1、GPIO 基本结构 STM32F407 的每个 GPIO 引脚均可独立配置,主要特性包括: 9 组 GPIO 端口…...

Word 小黑第15套

对应大猫16 修改样式集 导航 -查找 第一章标题不显示 再选中文字 点击标题一 修改标题格式 格式 -段落 -换行和分页 勾选与下段同页 添加脚注 (脚注默认位于底部 )在脚注插入文档属性: -插入 -文档部件 -域 类别选择文档信息,域…...

linux自启动服务

在Linux环境中,systemd是一个系统和服务管理器,它为每个服务使用.service文件进行配置。systemctl是用于控制系统服务的主要工具。本文将详细介绍如何使用systemctl来管理vsftpd服务,以及如何设置服务自启动。 使用Systemd设置自启动服务 创…...

react使用拖拽,缩放组件,采用react-rnd解决 -完整版

屏幕录制2025-03-10 10.16.06 以下代码仅提供左侧可视化区域 右侧数据根据你们的存储数据来 大家直接看Rnd标签设置的属性即可!!!!! /*** 用户拖拽水印的最终位置信息*/ export interface ProductWatermarkValue {wat…...

通过 ElasticSearch的Python API和`curl` 命令获取Elasticsearch 所有索引名称

导言 在大数据管理和实时搜索场景中,Elasticsearch 是一款不可或缺的工具。无论是开发调试、数据维护,还是系统监控,快速列出所有索引名称都是一个高频需求。本文将手把手教你如何通过 Python 客户端连接 Elasticsearch,并用两种方…...

Flutter:StatelessWidget vs StatefulWidget 深度解析

目录 1. 引言 2. StatelessWidget(无状态组件) 2.1 定义与特点 2.2 代码示例 3. StatefulWidget(有状态组件) 3.1 定义与特点 3.2 代码示例 4. StatelessWidget vs StatefulWidget 对比 5. StatefulWidget 生命周期 5.1…...

[密码学实战]Java实现国密TLSv1.3单向认证

一、代码运行结果 1.1 运行环境 1.2 运行结果 1.3 项目架构 二、TLS 协议基础与国密背景 2.1 TLS 协议的核心作用 TLS(Transport Layer Security) 是保障网络通信安全的加密协议,位于 TCP/IP 协议栈的应用层和传输层之间,提供: • 数据机密性:通过对称加密算法(如 AE…...

蓝桥杯省赛真题C++B组2024-握手问题

一、题目 【问题描述】 小蓝组织了一场算法交流会议,总共有 50 人参加了本次会议。在会议上,大家进行了握手交流。按照惯例他们每个人都要与除自己以外的其他所有人进行一次握手(且仅有一次)。但有 7 个人,这 7 人彼此之间没有进行握手(但这…...

项目实操分享:一个基于 Flask 的音乐生成系统,能够根据用户指定的参数自动生成 MIDI 音乐并转换为音频文件

在线体验音乐创作:AI Music Creator - AI Music Creator 体验者账号密码admin/admin123 系统架构 1.1 核心组件 MusicGenerator 类 负责音乐生成的核心逻辑 包含 MIDI 生成和音频转换功能 管理音乐参数和音轨生成 FluidSynth 集成 用于 MIDI 到音频的转换 …...

Java开发者如何接入并使用DeepSeek

目录 一、准备工作 二、添加DeepSeek SDK依赖 三、初始化DeepSeek客户端 四、数据上传与查询 五、数据处理与分析 六、实际应用案例 七、总结 【博主推荐】:最近发现了一个超棒的人工智能学习网站,内容通俗易懂,风格风趣幽默&#xff…...

多方安全计算(MPC)电子拍卖系统

目录 一、前言二、多方安全计算(MPC)与电子拍卖系统概述2.1 多方安全计算(MPC)的基本概念2.2 电子拍卖系统背景与需求三、MPC电子拍卖系统设计原理3.1 系统总体架构3.2 电子拍卖中的安全协议3.3 数学与算法证明四、数据加解密模块设计五、GPU加速与系统性能优化六、GUI设计与系…...

【数据库系统概论】第十一章 并发控制

第十一章 并发控制 11.1 并发控制概述(1)丢失修改(2)不可重复读(3)读“脏”数据 11.2 封锁11.2.1 封锁的概念11.2.2 基本封锁类型(1)排它锁/X锁/写锁(2)共享锁…...

C语言_数据结构总结4:不带头结点的单链表

纯C语言代码,不涉及C 0. 结点结构 typedef int ElemType; typedef struct LNode { ElemType data; //数据域 struct LNode* next; //指针域 }LNode, * LinkList; 1. 初始化 不带头结点的初始化,即只需将头指针初始化为NULL即可 void Init…...

用CSS画一条0.5px的线

上次面试前端被问到了这个问题,感觉有点懵懵的,我就回答了一个scaleY(0.5),这个是真的没想到,希望有需要的朋友可以去看看。随便记住一种就行。 1.第一种方式:通过缩放1px的线条实现视觉上的0.5px效果,兼容性较好。 …...

知识库全链路交互逻辑

阶段顺序 URL输入 → 网络连接 → 前端请求 → 后端处理 → 数据库交互 → 数据返回 → 前端渲染 → 连接关闭 阶段1:用户输入URL 用户行为:在浏览器地址栏输入 https://knowledge.com/search?keyword金融趋势 ​浏览器动作: “浏览器解析U…...