Skip to content
BugsFixing

BugsFixing

Find 100% working, tested solutions for Programming related issues. Daily Updated!

  • Home
  • Programming
  • Artificial Intelligence
  • Python
  • Quantum Computing
  • Java
  • Programming Bloggers

Tag: time-complexity

August 4, 2022 string

[SOLVED] Why is string::resize and string::substr O(1)

Issue I am working on a coding problem in which I have to delete all occurrences of a substring T in a string S (keeping in mind that removing one occurrence of T in S may generate a new occurrence

Continue reading
July 6, 2022 list

[SOLVED] Time complexity of casting lists to tuples in python and vice versa

Issue what is the time complexity of converting a python list to tuple (and vice versa): tuple([1,2,3,4,5,6,42]) list((10,9,8,7,6,5,4,3,1)) O(N) or O(1), i.e. does the list get copied or is something somewhere internally switched from writable to read-only? Thanks a lot!

Continue reading
July 5, 2022 list

[SOLVED] Improving Time Efficiency on two custom List in KOTLIN

Issue There are two lists: val listA:List<Amodel> val listB:List<Int> data class Amodel(val id:Int,var isUsed:Boolean=false) Need to update listA isUsed =true based on the int id of the listB What I’m doing now: listB.foreach(){ //here i’m updating but it’s taking too

Continue reading
July 3, 2022 arrays

[SOLVED] In JavaScript, from two array of objects I need to filter out objects based on a filter condition, in a new array in complexity less than O(n^2)

Issue Explanation of the problem statement : I have two arrays A and B : A = [ { "isAvailable" : true, "productCode" : "12103977", "size" : "UK/IND-3", "url" : "/asics-mens-gel-kayano-28-harmony-blue-running-shoes/12103977" }, { "isAvailable" : true, "productCode" : "12103978", "size"

Continue reading
June 20, 2022 algorithm

[SOLVED] What is the time complexity of heapq.nlargest?

Issue I was looking at this pycon talk, 34:30 and the speaker says that getting the t largest elements of a list of n elements can be done in O(t + n). How is that possible? My understanding is that

Continue reading
June 19, 2022 algorithm

[SOLVED] Finding time complexity of this loop?

Issue What’s time complexity of this loop? R = 40; while(R>=10){ x = x-1; R = R div 2; } I really appreciate if you explain it to me, too. Solution Each cycle the R is reduced to half. Therefore

Continue reading
June 19, 2022 algorithm

[SOLVED] What is the time complexity for this generic bruteforce/backtracking function?

Issue I am having trouble reasoning what the time complexity of this is. I was writing a backtracking function to solve a problem. To simplify, let’s just say I have a list of size "a" and I am allowed to

Continue reading
June 19, 2022 algorithm

[SOLVED] Time complexity of loop multiplying the value by two or three

Issue I found the below for-loop in an SO question. I found that the time complexity is O(n log n). How would I find the time complexity if we change k *= 2 to k *= 3? // ‘int n’

Continue reading
June 19, 2022 algorithm

[SOLVED] Check if array is sorted using O(1)

Issue Is it possible to check (in Java) if an array is sorted or not with O(1) worst time complexity? Solution It’s impossible to have a correct algorithm with better than O(n) complexity. Let’s prove it by contradiction. If are

Continue reading
June 12, 2022 algorithm

[SOLVED] Identifying the basic operation of an algorithm

Issue I am currently studying an algorithms unit at university and I can’t seem to get a clear answer from anyone about determining the basic operation of an algorithm. I understand it can occur in more than one place, but

Continue reading

Posts navigation

1 2 3 … 17 Next Posts»
  • [SOLVED] Css for displaying whole content within a cointainer of 100vh and make overflow scrollable
  • [SOLVED] How do I use an HTML inline tag inside a string?
  • [SOLVED] How to make a screenreader pronounce C# correctly
  • [SOLVED] How to draw a chart with Chart.JS?
  • [SOLVED] React cant read my argument inside my .map
  • [SOLVED] How can I save and restore Selection range in javascript?
  • [SOLVED] How do you change the link color of one specific link in WordPress?
  • [SOLVED] Stretch background image css?
  • [SOLVED] Counter in js with errors
  • [SOLVED] How to get the client ip address from browser in angular (typescript)
  • [SOLVED] my text input boxes ignores the width given
  • [SOLVED] how to reduce Nextjs Static HTML Export Page size on disk?
  • [SOLVED] How do I change text direction
  • [SOLVED] Can we use Bootstrap Icons for Bullet Points?
  • [SOLVED] HTML CSS Navbar stays at bottom of content unintentionally
  • [SOLVED] How to trigger "Save as Offline" Chrome Feature using JavaScript or onlick?
  • [SOLVED] R shiny: Add weblink to actionButton
  • [SOLVED] How to hover only the current li in nested ul?
  • [SOLVED] Dropdown menu overlaid by the content
  • [SOLVED] the input submit is outside of Form into div
  • [SOLVED] Why is the onClick event triggered twice?
  • [SOLVED] I can not build tailwindcss successfully
  • [SOLVED] How do I escape a single quote ( ' ) in JavaScript?
  • [SOLVED] Crop video in HTML?
  • [SOLVED] Switch between combox and radio buttons with CSS
  • [SOLVED] Multiple HTML files linked to only one Javascript file
  • [SOLVED] Different title when input invalid and input empty
  • [SOLVED] Add Hyperlinks to HTML using BeautifulSoup in Python using Anchor Text and URL stored in a CSV File
  • [SOLVED] Responsive Separator for Horizontal List
  • [SOLVED] How can I assign a number for a variable by using getElementById method in JavaScript
  • [SOLVED] Why the div preview, despite his position is set on relative appears inside the other div?
  • [SOLVED] Open a local .html on extension mouse click
  • [SOLVED] Display alternate image
  • [SOLVED] Meeting 508 Accessibility requirements for complex data tables
  • [SOLVED] Why does using the ".play" action not play this video?
  • [SOLVED] How can I make spacing for Outlook E-Mails?
  • [SOLVED] Fill the color in diamond shape to a specific height
  • [SOLVED] Bootstrap throws Uncaught Error: Bootstrap's JavaScript requires jQuery
  • [SOLVED] How put icon inside textarea?
  • [SOLVED] Why does my http://localhost CORS origin not work?
  • [SOLVED] How to make an Email link in html
  • [SOLVED] JComboBox setBackground() without changing the color of the arrow
  • [SOLVED] How does Python Pandas Transform work internally when passed a lambda question?
  • [SOLVED] How does Python Pandas Transform work internally when passed a lambda question?
  • [SOLVED] How does Python Pandas Transform work internally when passed a lambda question?
  • [SOLVED] How does Python Pandas Transform work internally when passed a lambda question?
  • [SOLVED] How does Python Pandas Transform work internally when passed a lambda question?
  • [SOLVED] Exclude subdirectory from WordPress redirection
  • [SOLVED] Exclude subdirectory from WordPress redirection
  • [SOLVED] Exclude subdirectory from WordPress redirection
WordPress Theme: Maxwell by ThemeZee.

Privacy Policy - Terms and Conditions