函数的渐近分析(Asymptotic analysis of functions)

我有以下函数来证明它的时间复杂度小于或等于O(xlogx)

f(x)= xlogx + 3logx2

我需要一些帮助来解决这个问题。


I have the following function to prove that its time complexity is less or equal to O(xlogx)

f(x) =xlogx+3logx2

I need some help to solve this.


原文:
2022-03-31 17:03

满意答案

您应该插入oc_product_option表,而不是加入它。 这只会返回已有选项的产品,而不是该类别中的所有产品。

INSERT INTO oc_product_option (product_id, option_id, value, required)
SELECT p.product_id, 15 AS option_id, '' AS value, 0 AS required
FROM oc_product AS p
JOIN oc_product_to_category AS c ON o.product_id = c.product_id
WHERE c.category_id = 98

实际上,甚至没有任何理由加入oc_product ,因为你没有使用该表中的任何内容。 你可以这样做:

INSERT INTO oc_product_option (product_id, option_id, value, required)
SELECT product_id, 15 AS option_id, '' AS value, 0 AS required
FROM oc_product_to_category
WHERE category_id = 98

You should be inserting into the oc_product_option table, not joining with it. That will only return products that already have options, not all the products in the category.

INSERT INTO oc_product_option (product_id, option_id, value, required)
SELECT p.product_id, 15 AS option_id, '' AS value, 0 AS required
FROM oc_product AS p
JOIN oc_product_to_category AS c ON o.product_id = c.product_id
WHERE c.category_id = 98

Actually, there isn't even any reason to join with oc_product, since you're not using anything from that table. You can just do:

INSERT INTO oc_product_option (product_id, option_id, value, required)
SELECT product_id, 15 AS option_id, '' AS value, 0 AS required
FROM oc_product_to_category
WHERE category_id = 98

相关问答

更多

MYSQL子查询需要返回多行,每个结果来自父查询的LIMIT 5(MYSQL subquery needs to return multiple rows with LIMIT 5 per result from the parent query)

弄清楚了。 希望这有助于其他人。 如果效率低,请随意添加。 SET @rn = 0; SET @prev = 0; SELECT name, tot_yds, tot_tds FROM ( SELECT p.name, SUM(s.yds) AS tot_yds, SUM(s.tds) AS tot_tds FROM players AS p INNER JOIN ( SELECT ...

MYSQL:LIKE(子查询)返回许多行(MYSQL: LIKE (subquery) returning many rows)

为什么不简单; SELECT Message FROM SystemEventsR s JOIN users u ON s.Message LIKE CONCAT('%',u.username,'%') 用于测试的SQLfiddle 。 Why not simply; SELECT Message FROM SystemEventsR s JOIN users u ON s.Message LIKE CONCAT('%',u.username,'%') An SQLfiddle t...

子查询返回多行 - Mysql(Subquery returns more than one row - Mysql)

尝试这个 select count(*) as cityCount, answer from B inner join A on B.answer = A.city group by answer Try this select count(*) as cityCount, answer from B inner join A on B.answer = A.city group by answer

在子查询mysql中返回多行(return multiple rows in subquery mysql)

使用连接: SELECT A.*, B.tag FROM crm_stores A LEFT JOIN crm_tags B ON A.tags LIKE concat(concat('%',B.tag_id),'%') 新的mysql小提琴: http ://sqlfiddle.com/#!9/ dedeb1/7/0 use a join: SELECT A.*, B.tag FROM crm_stores A LEFT JOIN crm_tags B ON A.tags ...

mysql子查询返回多行获取单个用户的多行(mysql subquery returns more than 1 row getting multiple rows of a single user)

SELECT user.username,user_image.image FROM user INNER JOIN user_image ON user.user_id = user_image.user_id; INNER JOIN根据它们的公共列(在本例中为user_id)组合这两个表。 SELECT user.username,user_image.image FROM user INNER JOIN user_image ON user.user_id = user_image...

MySQL子查询错误:子查询返回超过1行(MySQL subquery error: Subquery returns more than 1 row)

你可以使用: SELECT * FROM events WHERE id IN (SELECT event_id FROM booking_dates WHERE user_id = '{$user_id}') 警告:在SQL中注入类似的字符串会使它们容易受到SQL注入攻击。 请查看准备好的语句 ,您可以在没有此漏洞的情况下绑定参数 。 You could use in: SELECT * FROM events WHERE id IN (SELECT event_id FROM booki...

MySQL子查询返回多行,如何解决?(MySQL subquery returning more than one row, how to workaround?)

使用IN而不是= select distinct * from oglasi where id IN (select distinct ... ^^ Use IN instead of = select distinct * from oglasi where id IN (select distinct ... ^^

子查询返回多行MySQL(Subquery returns more than 1 row MySQL)

您不能让相关子查询返回多行。 你可以做的一件事是使用LEFT JOIN而不是相关的子查询: SELECT c.name, cc.code AS USSIC_Code FROM insure_prod.company c LEFT JOIN insure_prod.companyclassification cc on c.OIQ_ID = cc.ussicClassification_StdCompany; 这将为insure_prod.companyclassification表中不存...

从多SELECT子查询返回多行(Return multiple rows from multi SELECT subquery)

在MySQL中处理这个以使用变量, union all和聚合的一种方法: SELECT MAX(NAME) as NAME, MAX(PROJECT_NAME) as PROJECT_NAME, MAX(FILTER_NAME) as FILTER_NAME FROM ((SELECT (@rnpc := @rnpc + 1) as rn, NAME, NULL as PROJECT_NAME, NULL as FILTER_NAME FROM product_compo...

Mysql子查询返回多行(Mysql subquery return multiple row)

您应该插入oc_product_option表,而不是加入它。 这只会返回已有选项的产品,而不是该类别中的所有产品。 INSERT INTO oc_product_option (product_id, option_id, value, required) SELECT p.product_id, 15 AS option_id, '' AS value, 0 AS required FROM oc_product AS p JOIN oc_product_to_category AS c ON...

相关文章

更多

计算机病毒及其防治 Computer Virus Analysis and Antivirus

Episode I 计算机病毒的历史 FUDAN UNIVERSITY 3 ...

zz Data Analysis Process

An interesting article....easy to understand. Summa ...

企业级搜索引擎Solr 第二章 Schema和文本分析(Schema and Text Analysis)[2]

文章转载自网易博客,原文地址:http://quweiprotoss.blog.163.com/blo ...

Solr参数(Analysis Collection Common CoreAdmin)

一.Analysis 1.analysis.query:Holds the query to be a ...

Solr官方文档系列——Text Analysis

Text fields are typically indexed by breaking the t ...

java.lang.NoClassDefFoundError: org/apache/lucene/analysis/synonym/SynonymFilter

2013-6-24 13:28:51 org.apache.solr.common.SolrExcep ...

【流式计算】Twitter Storm源代码分析之Tuple是如何发送的

作者: xumingming | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权 ...

Storm数据流模型的分析及讨论

转自:http://www.cnblogs.com/panfeng412/archive/2012/0 ...

[zz]Twitter Storm源代码分析之ZooKeeper中的目录结构

作者: xumingming | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明 ...

微信公众平台开发(62)股票行情及分析

微信公众平台开发 微信公众平台开发模式 企业微信公众平台 股票查询 股票行情 股票基本面分析 股票技术 ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本