Search:

Type: Posts; User: ramayana

Search: Search took 0.00 seconds.

  1. Thread: Quick Sort

    by ramayana
    Replies
    9
    Views
    1,719

    temp=pivot; pivot=a[j]; a[j]=temp;...

    temp=pivot;
    pivot=a[j];
    a[j]=temp;

    if changed to



    temp=a[low];
    a[low]=a[j];
  2. Thread: Quick Sort

    by ramayana
    Replies
    9
    Views
    1,719

    Sorry for the indentation this is the best I...

    Sorry for the indentation this is the best I could manage , about the main() this is the way I do and I don't think it comes in the way of the program . I have tried tracing the program but the...
  3. Thread: Quick Sort

    by ramayana
    Replies
    9
    Views
    1,719

    Quick Sort

    This program is supposed to impelement quicksort but it is not working



    include<stdio.h>
    #include<conio.h>
    #include<process.h>
    void quicksort(int a[] ,int low,int high);
    int partition(int...
  4. Replies
    3
    Views
    1,097

    ok , if that happens "c" and "d" won't be...

    ok , if that happens "c" and "d" won't be executed as the block following if will be skipped.
  5. Replies
    3
    Views
    1,097

    Recursion problem

    Given below is a function which is part of a bigger program implementing Merge Sort http://linux.wku.edu/~lamonml/algor/sort/merge.html


    void merge_sort(int a[], int low , int high) //a
    {
    ...
  6. Replies
    5
    Views
    3,042

    Can it be because I'm using float and not double ...

    Can it be because I'm using float and not double and beacuse the time elapsed is small enough that it doesnt fit onto the float format?
  7. Replies
    5
    Views
    3,042

    Problem woth CLK_TCK

    I'm supposed to do a sequential earch on integers and also retun the time elapsed on doing such a search . Here is what I have.




    #include<stdio.h>
    #include<conio.h>
    #include<time.h>
    void...
  8. Thread: Bytes

    by ramayana
    Replies
    10
    Views
    2,343

    An integer(default in type) type occupies the...

    An integer(default in type) type occupies the whole word length of a computer as it's storage . Hence , for a 16 bit computer(my case) one integer occupies 16 bits or convinently 2 bytes. For an...
  9. Replies
    160
    Views
    1,230,485

    Sticky: ANSI C - E . Balagurusumy...

    ANSI C - E . Balagurusumy

    This is the best C primer book especially if you get hold of the latest edition. Especially good for learning the basics of the language as all possible syntax of any new...
  10. Thread: Queues

    by ramayana
    Replies
    22
    Views
    5,010

    Yes there is ...we are required to implement...

    Yes there is ...we are required to implement queues using array here ...I know this would increase the code length as using link list to implement the same problem is rather easy ....but this is the...
  11. Thread: Queues

    by ramayana
    Replies
    22
    Views
    5,010

    ok will keep it in mind, still the problem though...

    ok will keep it in mind, still the problem though remains unresolved
  12. Thread: Queues

    by ramayana
    Replies
    22
    Views
    5,010

    Sorry but this is the smallest main function I...

    Sorry but this is the smallest main function I could manage...May be it can be further decomposed into smaller functions but being an absolute rookie in C (my experience with C is as of today 15 days...
  13. Thread: Queues

    by ramayana
    Replies
    22
    Views
    5,010

    Queues

    Hello , I'm suppposed to make three queues and then insert,delete and display items in them according to a given priority
    So, if the user enters priority as 1/2/3 then I'm supposed to...
  14. Replies
    12
    Views
    1,453

    Oh thanks now i understand

    Oh thanks now i understand
  15. Replies
    12
    Views
    1,453

    M friend got my code corrected, there are two...

    M friend got my code corrected, there are two changes that he made....



    fprintf(fp,"%d %s %d %d %d ",st.usn,st.name,st.marks1,st.marks2,st.marks3);
    /* blank space between the control strings*/...
  16. Replies
    12
    Views
    1,453

    As i said I've reformatted my code ...the code...

    As i said I've reformatted my code ...the code I've used before was wrong i know it ...I'd posted above the correct code after your advice



    void display(FILE*fp)
    {
    STD st;/*declares...
  17. Replies
    12
    Views
    1,453

    My apologies ....when I said I'm posting the...

    My apologies ....when I said I'm posting the "reformed" code i"d posted infact a code that was still half done ......
    This is the code which I'd written after the advice .....




    /* DS lab...
  18. Replies
    12
    Views
    1,453

    Thanks a lot ....sorry for the crappy code but...

    Thanks a lot ....sorry for the crappy code but the text editor I use
    is crappy itself and this is the best I could managae.

    My compiler would issue a "function should return value" if i use int...
  19. Replies
    12
    Views
    1,453

    Thanks a lot .... But I'm still having problem...

    Thanks a lot .... But I'm still having problem with my program..With your advice i have reformed my code as follows




    /* DS lab program 1*/
    #include<stdio.h>
    #include<conio.h>...
  20. Replies
    12
    Views
    1,453

    help with my code

    As part of my Data Structures lab I'm required to write a program
    to create a sequential file to store the following
    USN(integer type) ,Name, Marks1 ,Marks2 ,Marks3

    Then search using the USN for...
  21. Replies
    2
    Views
    1,165

    dynamic file handling help

    I'm having problem understanding the concepts of ftell(),fseek etc.
    i need to know
    a)the general syntax of ftell() is ....n=ftell(file_pointer);
    supppose for a file to which i have already...
  22. Replies
    4
    Views
    2,465

    heh ok

    heh ok
  23. Replies
    4
    Views
    2,465

    But 'sum' I thought is of type float and the...

    But 'sum' I thought is of type float and the whole expression is
    real expression and hence the right hand side of the assignment operator sum=sum+(1/deno) should be of type float ,isnt it ?
  24. Replies
    2
    Views
    1,834

    Integer and the no. of bits it occupy

    I"m beginning to learn C .The book I follow tells that when any variable has been declared as type int , in 32 bit computer the maximum integer that can be stored is 2147483647 while on 16
    bit it is...
  25. Replies
    4
    Views
    2,465

    Help with program harmonic series

    I have tried to code the following harmonic series as below but the progrma outputs 1.000000 only, could someone point out where the flaw is ?

    1+1/2+1/3+...........+1/n




    #include<stdio.h>...
Results 1 to 25 of 25