(转载)Two Sum Problem : aiming at (log n) square complexity

版主: hci

回复
heteroclinic(Heteroclinic)楼主
著名点评
著名点评
heteroclinic 的博客
帖子互动: 37
帖子: 3688
注册时间: 2022年 10月 31日 00:35

#1 (转载)Two Sum Problem : aiming at (log n) square complexity

帖子 heteroclinic(Heteroclinic)楼主 »

此帖转自 heteroclinic 在 STEM 的帖子:Two Sum Problem : aiming at (log n) square complexity

https://github.com/wangzhikai/TwoSumPro ... /README.md


TwoSumProblem

Two Sum Problem - - the well-known tech interview question and proposed solution aiming at (log n) square time complexity and O(1) space complexity.

The high level algorithm design is documented here. text

The original work of mine, POC completed is as this file. text

I asked Chatgpt to review the code. It provided a more concise version plus more test cases. Again, it is still POC protype and I don't aim it having the industry level robustness. text

With the assistance of Chatgpt, we are able to construct worst case test data. Which makes time complexity O(n). text

I have been thinking of the worst case for days. According to the analysis in the pdf file, I decided to add one step per loop in the algorithm "opportunistic guessing". It is not purely opportunistic as discussed in the pdf file. Chatgpt quickly implemented the idea as a Python file. text It shows case we can beat the O(n) case with a O( log^2 n) approach. I have not got the chance to thouroughly review the Python file. Any comments will be welcome!

Further Research An immediate application of this problem can be for Goldbach’s conjecture as computer validation in limited scope. A large enough even number is the sum of two prime numbers. Given a large even number t and a complete list of prime numbers in scope, we can search for two prime numbers one is less than t/2 and the other is greater than t/2.

Acknowledgement Thanks to Leetcode presenting the problem to the ardent CS students and programmers! I used Node JS, VS Code + Copilot for the POC. Chatgpt greatly speeds up orginal research. Python is also used in the POC of code and visualizing important clues. Here are some chat histories with Chatgpt: https://chatgpt.com/share/682cc20d-57d0 ... 460c77d0a2 https://chatgpt.com/share/682cc226-2e38 ... 60ee0c65e8 https://chatgpt.com/share/682cc258-324c ... 471a70e78e
heteroclinic(Heteroclinic)楼主
著名点评
著名点评
heteroclinic 的博客
帖子互动: 37
帖子: 3688
注册时间: 2022年 10月 31日 00:35

#2 Re: (转载)Two Sum Problem : aiming at (log n) square complexity

帖子 heteroclinic(Heteroclinic)楼主 »

本人有一定的预算支付给reviewer 合理成本.多谢!
头像
hci(海螺子)
论坛支柱
论坛支柱
帖子互动: 425
帖子: 9704
注册时间: 2022年 7月 22日 15:29

#3 Re: (转载)Two Sum Problem : aiming at (log n) square complexity

帖子 hci(海螺子) »

是想发表么?
heteroclinic 写了: 2025年 5月 20日 16:54 本人有一定的预算支付给reviewer 合理成本.多谢!
heteroclinic(Heteroclinic)楼主
著名点评
著名点评
heteroclinic 的博客
帖子互动: 37
帖子: 3688
注册时间: 2022年 10月 31日 00:35

#4 Re: (转载)Two Sum Problem : aiming at (log n) square complexity

帖子 heteroclinic(Heteroclinic)楼主 »

hci 写了: 2025年 5月 20日 18:07 是想发表么?
是,版主有路子么?
要求不高稍微正式点的刊物就行。
有朋友connections 介绍一下也好。润色润色,改进改进。

多谢!
头像
hci(海螺子)
论坛支柱
论坛支柱
帖子互动: 425
帖子: 9704
注册时间: 2022年 7月 22日 15:29

#5 Re: (转载)Two Sum Problem : aiming at (log n) square complexity

帖子 hci(海螺子) »

自己投一下不就行了么?投稿还要路子?投一下,根据reviewer的评论改进就行了。
heteroclinic 写了: 2025年 5月 21日 11:55 是,版主有路子么?
要求不高稍微正式点的刊物就行。
有朋友connections 介绍一下也好。润色润色,改进改进。

多谢!
上次由 hci 在 2025年 5月 21日 12:38 修改。
原因: 未提供修改原因
heteroclinic(Heteroclinic)楼主
著名点评
著名点评
heteroclinic 的博客
帖子互动: 37
帖子: 3688
注册时间: 2022年 10月 31日 00:35

#6 Re: (转载)Two Sum Problem : aiming at (log n) square complexity

帖子 heteroclinic(Heteroclinic)楼主 »

hci 写了: 2025年 5月 21日 12:37 自己投一下不就行了么?投稿还要路子?投一下,根据reviewer的评论改进就行了。
以前试过,好像据稿不需要理由too.和武侠小说了主持,观主也没啥区别.
都是宰圈子外的.

为了避免浪费宝贵的时间与资源,还是得找对人.
回复

回到 “葵花宝典(Programming)”