Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 905737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:16:07+00:00 2026-05-15T16:16:07+00:00

Hi I suppose to write a program that show the run time complixity I

  • 0

Hi I suppose to write a program that show the run time complixity
I solved two but can’t solve the third the code is :

{
class Program
{
    /* static long F1(long n)
     {
         long sum = 0;
         for (int k = 1; k <= n; k++)
         {
             for (int j = 1; j <=n*n; j++)
             {
                 for (int m = 1; m <=j; m++)
                 {
                     sum = sum + 1;
                 }
             }
         }
         return sum;
      }
    static long F2(long n)
     {
         long sum = 0;
         for (int k = 1; k <= n; k++)
         {
             for (int j = 1; j <= n ; j++)
             {
                 for (int m = 1; m <= j; m++)
                 {
                     sum = sum + 1;
                 }
             }
         }
         return sum;

     }*/
  static long F3(long n)
  {
      long prod = 1;
      long m;
      long i = 2;
      long s = n;
      while (n >= 1)
      {
          m = 1;
          while (m <= n)
          {
              prod = prod * 2;
              m = m + 1;
          }
          n = s / i;
          i++;
      }
         return prod;

     }


    static void Main(string[] args)
    {
       // Console.WriteLine(F1(100));
       // Console.WriteLine(F2(2200));
     Console.WriteLine(F3(10000));
        long x; 
        DateTime d1=DateTime.Now;
        x=d1.Ticks;
     // F1(600);  
    //    F2(2200);
        F3(1000);
        DateTime d2=DateTime.Now;
        x=(d2.Ticks-x)/10000000;
        Console.WriteLine("x=" + x.ToString());
        Console.ReadLine();
    }
}

}

now the correct answers that F3 should show are

300000000   0   5
400000000   0   4
500000000   0   7

but all what i got is o o o

while the F2 and F1 are showing right answers can any one help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:16:07+00:00Added an answer on May 15, 2026 at 4:16 pm

    What I wonder is: isn’t it just a matter of integer division?

    I mean here: x=(d2.Ticks-x)/10000000;

    Note: I’m not practical with C#, it’s just an hypothesis

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

suppose we have two numbers i want write program which print common bits subsequent
I've heard that the advantage of java is that people can write code, compile
I wrote the following program that is suppose to start up, show the form
Suppose you want to write a program that implements a simple phone book. Given
Here is what I'm suppose to accomplish: Write a program that stimulates a bean
My understanding is that it means that one can potentially write a program to
I am supposed to write a program that gets some PNG images from the
Suppose I want to write an app for Android OS that is not going
Suppose I let the user to write a condition using Javascript, the user can
Suppose that I have two data types Foo and Bar. Foo has fields x

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.