Skip to content

Tutorial Guruji

Online Free Tutorials Guruji Guide & Materials – Solved Questions Answers

  • Home
  • Tutorials
    • Java
    • DBMS
    • Linux
    • for loop
    • Bitcoin Transaction Fees
    • Mathematics Real Analysis
    • Shell Script
    • Bitcoin Core
    • Bitcoin Security
    • Grammar
  • About Us
  • Contact Us
Home ยป time-complexity

Tag: time-complexity

Time complexity of typecasting double to int in Java

Java April 10, 2021

double val = 500.00; int val2 = (int) val; What is the time complexity of typecasting in the previous example? Is it O(1)?

count repeated elements in a string

Java April 7, 2021

The question is to find the number of consecutive occurrences of a character ‘*’ in a string. I’ve written a program for it but is there any other efficient way to solve this for(int i=0;i<...

Problem figuring out time and space complexity?

C++ April 3, 2021

The question was to check whether two strings are rotation of each other or not. So, here is the function I wrote for the same: bool areRotations(string s1, string s2) { int n1 = …

Time complexity for HashMap put/get inside for?

Java June 21, 2020

Suppose I have the following code fragment: for(int i=0; i < n.length(); i++) { int aux = n[i]; if(map.containsKey(aux)) { map.put(aux, map.get(aux)+1); } else { map.put(...

calculate the max length of an array such that average is less than given value

Java August 19, 2018

I’ve beern trying to solve this question but getting timeout for most test cases. Can anyone help me in optimising this? Problem Statement : You are given an array A of length N. You have to choose …

HashSet look-up complexity?

Java July 4, 2011

A look-up operation OR contains for single can be O(n) in worst-case right ? So, for n elements look up in hashSet will be O(n^2)?

Skip to footer

Recent Articles

  • Python century date process
  • Python, Pandas: Keep only the newest and unique data inside dataframe
  • pymc3: Truncated Normal mixture
  • Mixed Date Formats Update
  • Pygame telling me that a image isn’t a file object

What You Want To Learn?

  • Android
  • AngularJS
  • Bitcoin Core
  • Bitcoin Exchanges
  • Bitcoin Security
  • Bitcoin Transaction Fees
  • Bitcoin Transactions
  • C#
  • C++
  • DBMS
  • for loop
  • Grammar
  • HTML
  • Java
  • JavaScript
  • jQuery
  • Linux
  • Mathematics Real Analysis
  • Node.js
  • PHP
  • Python
  • React JS
  • Shell Script
  • Travel
  • WordPress

Contact Details

Web: tutorialguruji.com
For Advertisement - Contact Us Today.
Tutorial Guruji