计算复杂度 - 1^n + n^4 + 4n + 4

时间:2021-03-28 10:44:05

标签: big-o complexity-theory

谁能解释一下正确答案应该是什么:

问题 = 1^n + n^4 + 4n + 4 的复杂度是多少?

选项 = 指数、多项式、线性、常数

我的解释: 答案应该是指数的,因为 O() 的加法法则是答案是主导项,即 1^n 又名 c^n(c = 常数)又名指数。但答案是错误的,我不明白:(

1 个答案:

答案 0 :(得分:1)

好吧,1^n 总是 1。因此,(gtk3_test2.exe:20924): GLib-GIO-WARNING **: 12:33:38.982: win32 session dbus binary not found: C:\Users\user\source\repos\gtk3_test2\gtk3_test2\\gdbus.exe (gtk3_test2.exe:20924): Gtk-WARNING **: 12:33:40.054: Could not load a pixbuf from icon theme. This may indicate that pixbuf loaders or the mime database could not be found. ** Gtk:ERROR:../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load C:\Users\user\AppData\Local\icons\Adwaita\16x16/status\image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3) Bail out! Gtk:ERROR:../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load C:\Users\user\AppData\Local\icons\Adwaita\16x16/status\image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3) 可以简化为 C:\Users\user\AppData\Local\icons\Adwaita\16x16/status\image-missing.png 。因此,1^n + n^4 + 4n + 4

所以正确答案是多项式。