12
返回列表 发新帖
楼主: mricoo

[PL/SQL] 比较两个字符串中连续几个字符相同的

[复制链接]
论坛徽章:
0
11#
发表于 2024-3-13 09:54 来自手机 | 只看该作者
Happened to read article about bGPT/Transformer in sins.com today.  Briefly, it is true no need to check byte one by one if, say bind 4 bytes in sequence and index it by a larger number, chr(1)*1000000+chr(2)*10000+chr(3)*100+chr(4).  So one may compare 4 bytes every time but remember to extract other strings in between use math and check instr in s2.  Any work done upfront will save time later.  In fact, the whole string s1 or s2 can be considered as a large number (if resource allows), and loop processes are a bunch of math operations.  After all, forget coding and just ask chatGTP to do the dirty work to same time and money.  lol

使用道具 举报

回复
论坛徽章:
520
奥运会纪念徽章:垒球
日期:2008-09-15 01:28:12生肖徽章2007版:鸡
日期:2008-11-17 23:40:58生肖徽章2007版:马
日期:2008-11-18 05:09:48数据库板块每日发贴之星
日期:2008-11-29 01:01:02数据库板块每日发贴之星
日期:2008-12-05 01:01:03生肖徽章2007版:虎
日期:2008-12-10 07:47:462009新春纪念徽章
日期:2009-01-04 14:52:28数据库板块每日发贴之星
日期:2009-02-08 01:01:03生肖徽章2007版:蛇
日期:2009-03-09 22:18:532009日食纪念
日期:2009-07-22 09:30:00
12#
发表于 2024-3-13 21:30 | 只看该作者
jihuyao 发表于 2024-3-13 09:54
Happened to read article about bGPT/Transformer in sins.com today.  Briefly, it is true no need to c ...

你是想一下子比较多个字符,那么你就要采用一种N进制表示法,N要足够大,还要考虑字符有重复的情况如何处理。还需要把所有子串都进行预处理。但是这个问题中,子串的长度是未知的,这个技巧也用不上。

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表