Search:

Type: Posts; User: Stuart Dickson

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    1,567

    Thanks a lot xabhi. Actually where I made mistake...

    Thanks a lot xabhi. Actually where I made mistake was that I was treating negative value as false.
  2. Replies
    6
    Views
    1,567

    I have put this question for help. If you know...

    I have put this question for help. If you know answer tell it to me.
  3. Replies
    7
    Views
    3,183

    I have put this question for help. If you know...

    I have put this question for help. If you know answer tell it to me.
  4. Replies
    7
    Views
    3,183

    Output of program

    Hello,

    I executed this program and output was "C". Can someone expain why it was output and not "C++". Thanks.


    int main(){
    float a = 0.7;
    if(a < 0.7)
    printf("c");
    else
  5. Replies
    6
    Views
    1,567

    Output of program

    Hello,

    When I executed this program I got output -2 3 0 1. Can anyone explain what how this calculation is reached in program below. Thanks


    int main(){
    int i = -3, j = 2, k = 0, m;
    m = ++i...
  6. Replies
    3
    Views
    1,297

    Point in or out

    Hello.

    Given a polygon (could be regular, irregular, convex, concave), find out whether a particular point lies inside it or outside it.

    This question was asked within an interview. what should...
  7. Replies
    7
    Views
    6,033

    I think it would be O(n log n) because every node...

    I think it would be O(n log n) because every node will be visited atleast once.
  8. Replies
    7
    Views
    6,033

    I am looking for both average as well as worst...

    I am looking for both average as well as worst case.
  9. Replies
    7
    Views
    6,033

    Time Complexity

    Hello.

    Can someone explain what is time complexity of this algorithm :


    int maxDepth(struct node* node) {
    if (node==NULL) {
    return(0);
    }
    else {
  10. Thread: Atoi()

    by Stuart Dickson
    Replies
    4
    Views
    2,580

    Thanks. I modified code as below, but still...

    Thanks.

    I modified code as below, but still answer is not correct.


    #include<iostream>
    #include<string>
    #include<cmath>
    using namespace std;
  11. Thread: Atoi()

    by Stuart Dickson
    Replies
    4
    Views
    2,580

    Atoi()

    Hello.

    I am trying to implement atoi(). Below is my code. It compiles correctly, but output is not correct. can anyone correct what wrong i am doing in logic here.
    Here is my code.

    ...
  12. Replies
    4
    Views
    2,180

    Thanks for your reply "zacs7" You said that ,...

    Thanks for your reply "zacs7"

    You said that , "And perhaps mention that heap allocations may be optimised for large allocations."

    What do you exactly mean by that ?

    Thanks.
  13. Replies
    4
    Views
    2,180

    Stack or Heap ?

    Hello Guys.

    Why do we prefer huge memory allocations on heap rather then on stack (I am aware of general differences between heap and stack and how allocations are done in both - stack and queue)...
  14. Replies
    10
    Views
    4,562

    Hey guys !! Thanks a lot for your replies. ...

    Hey guys !!

    Thanks a lot for your replies.

    iMalc you are correct here. By comparision, I meant object comparision only.

    Give us the link now :)
  15. Replies
    10
    Views
    4,562

    yeah...it's not returning bool....typo...

    yeah...it's not returning bool....typo mistake.......But the point is how we can optimize this code. Can anybody help ? Thanks for your help.
  16. Replies
    10
    Views
    4,562

    Optimize binary search

    Hello.

    I gave written test at Adobe, Bangalore. There was a question to optimize Binary search. Below is the normal code for Binary search. How can we optimize it so that there is only one...
Results 1 to 16 of 16