Search:

Type: Posts; User: dotnet13

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,347

    Processing outputs of multiple inputs

    It's not something trivial but I would like to know the best way to process multiple outputs, for example:

    Input
    First line of input will contain a number T = number of test cases. Following...
  2. Replies
    13
    Views
    1,433

    What are you? Einstein of Algo? I don't think so,...

    What are you? Einstein of Algo? I don't think so, if you're that good then why you are spending time in a forum, why don't you make a new Programming Language or work for Google/Microsoft? You're not...
  3. Replies
    13
    Views
    1,433

    I dont know what you are saying, but for a N x M...

    I dont know what you are saying, but for a N x M matrix it become O(n log m) since there are N rows and for every row it's log m, if we apply Binary search
  4. Replies
    13
    Views
    1,433

    that is what I wanted to know, if Im scanning...

    that is what I wanted to know, if Im scanning through every element in a list/array the worst case will be O(n) because the element can be at the last position and don't try to confuse me with a...
  5. Replies
    13
    Views
    1,433

    How O(log n) time is calculated?

    I know Binary Search has O(log n) complexity because we don't go on checking every values to search like Linear Search. But Im still not sure how O(log n) is calculated for other programs, I mean how...
  6. Replies
    6
    Views
    1,549

    O(2^n) and O(n!) complexity?

    I'm familiar with most of the algorithm time complexity, but not fully sure about exponential and factorial complexity, I know most of the time recursion takes exponential time but is there any other...
  7. Thread: Output issues

    by dotnet13
    Replies
    6
    Views
    1,042

    this type of problems are better to solve using...

    this type of problems are better to solve using dynamic programming technique, it'll also optimize your code in terms of time, try it if you can.
  8. Replies
    9
    Views
    1,565

    with loop it'll be like this: int...

    with loop it'll be like this:

    int A[5]={1,3,5,7,9}, B[]={2,4,6,8,10}, C[10];

    int count=0;

    for(int i=0;i<5;i++)

    {
  9. Just do a linear search, it's an O(n) time...

    Just do a linear search, it's an O(n) time algorithm but will do the work for you, better if you use Binary Search, it has O(log n) complexity and very efficient for large number of input.
  10. Replies
    9
    Views
    1,565

    can you give a sample input and output so it'll...

    can you give a sample input and output so it'll be easy to understand?
  11. Replies
    1
    Views
    716

    Problem with scanf() character check

    char value;

    printf_s("enter:");

    if (scanf_s("%c", &value) != 1)

    {

    printf_s("oppppssss \n");
  12. Thread: Loop Infinite

    by dotnet13
    Replies
    4
    Views
    924

    If you to want to create an infinite loop if the...

    If you to want to create an infinite loop if the input is not 1, then this'll do:

    int num;

    printf_s("Insert the Value: ");

    scanf_s( "%d", &num );
  13. Thread: Brute-force?

    by dotnet13
    Replies
    3
    Views
    1,587

    thank you people

    thank you people
  14. Thread: Brute-force?

    by dotnet13
    Replies
    3
    Views
    1,587

    Brute-force?

    Im kinda confused about this brute-force programming thing, can anyone give me a simple example of it?
  15. Replies
    6
    Views
    1,010

    Thanks a lot, great explanation

    Thanks a lot, great explanation
  16. Replies
    12
    Views
    1,303

    Hmm, I see thanks a lot for clear explanation

    Hmm, I see thanks a lot for clear explanation
  17. Replies
    6
    Views
    1,010

    I see, but how the summation is done?

    I see, but how the summation is done?
  18. Replies
    6
    Views
    1,010

    The way recursive calls actually works

    This is simple recursive solution of Fibonacci number:


    int fibo(int n)
    {
    if(n<=1)
    return 1;
    else
    return fibo(n-1)+fibo(n-2);
    }
  19. Replies
    12
    Views
    1,303

    Ok that makes sense, but what do you mean by...

    Ok that makes sense, but what do you mean by [1][5] or [2][5] ? The inner loop suppose to end at [0][4], [1][4], [2][4] because j<5, so 0,1,2,3,4 then exit the inner loop.
  20. Replies
    12
    Views
    1,303

    a bit more explanation would be appreciated, I...

    a bit more explanation would be appreciated, I mean why the val prints 0 0 0 when it's on top of the inner loop and prints 0 0 -858993460 when printf is after the inner loop, what is going on in the...
  21. Replies
    12
    Views
    1,303

    I see, but if I put the printf right above the...

    I see, but if I put the printf right above the inner loop (top of inner loop) the output becomes 0 0 0, so how the third value becomes part of the array now? I mean arr[3][5]







    ...
  22. Replies
    12
    Views
    1,303

    That makes sense, but why the 1st and 2nd value...

    That makes sense, but why the 1st and 2nd value is 0, why not garbage?
  23. Replies
    12
    Views
    1,303

    Got confused over a C program

    int main(void){


    int arr[3][5]={ {0,0,0,0,0},
    {0,0,0,0,0,},
    {0,0,0,0,0,}
    };
    int i,j,val;

    for(i=0; i<3;i++)
  24. Need solution for some problems urgently!!!!

    1264612647126481264912650
Results 1 to 24 of 24