Monday, April 27, 2015

Binary Search animation ported to ubuntu

 This project being done by one of my students is about binary search animation. Using quick sort the given array is sorted first. Then it is searched. There is a menu which appears on right click. If you don't mind the delay then this can be a good program to demonstrate binary search. This project was working in windows initially and with slight tweaks its now running in ubuntu.

Snapshots:







enter the value of n
5
enter the values
4 3 1 5 2

Enter the search value<-----2

press ENTER

------------GO TO THE WINDOW AND CLICK LEFT MOUSE BUTTON-------------

Here is the source.


17 comments:

  1. Is this code supports in Windows???

    ReplyDelete
  2. Its not working in ubuntu either

    ReplyDelete
  3. I have got error c2440:'=':connot convert from const char* to char*..how do I fix this error

    ReplyDelete
    Replies
    1. I think you are getting it at the line where my_itoa is being called.
      I faintly remember converting this windows project to work on Ubuntu. To reverse the process just change s1=my_itoa(buf[I]); to itoa(buf[i],s1,10);

      Delete
    2. It is exactly working sir .thank you so much

      Delete
    3. Can u send me the exact code please

      Delete
    4. @Savitri can u please send me the correct code.im getting the same error...email:suhascj.scj@gmail.com

      Delete
    5. This comment has been removed by the author.

      Delete
    6. @Suhas if you are working in linux then the code i shared should work. If in windows the itoa function in stdlib.h can be used. Plz include stdlib.h and tell me.

      Delete
  4. sir i am getting this error:
    error LNK2019: unresolved external symbol _snprintf referenced in function _my_itoa_buf
    how do i fix it?

    ReplyDelete
  5. I am getting a glut error what is that. Please help

    ReplyDelete
    Replies
    1. Sir the mouse func isnt working proper and there are a lot of warnings please help sir .

      Delete
  6. sir can u send me the code with few changes..because this code is giving me a lot of warnings and the display is not in a organized manner.

    ReplyDelete
  7. sir can u plz send this code for ubuntu .. to akhilk9482@gmail.com.. im getting some errors.. i can not solve it.. its urgent.. plz sir

    ReplyDelete
  8. I'm getting error msg as invalid conversion

    ReplyDelete
  9. Sorry to say this but the program was written years ago on my laptop that has become outdated after it could not support the OS upgrade minimum requirements of memory and CPU power. Now the only way I can check the error is by hiring compute power on the cloud and running the program there. I have an azure account but wonder how much it would cost for the setup and rent per hour of usage. Would be happy to do this task for you... my mail address is kamathbol@gmail.com. Thanks for your interest in programs posted here. Cannot guarantee it but service deadlines might be exceeded in rare instances.

    ReplyDelete