programming practice exercises

int ReverseString(char *); main() { char *Str; printf(“enter any stringn”); gets(Str); ReverseString(Str); getch(); } int ReverseString(char *rev) { if(*rev!=’’) { ReverseString(rev + 1); putchar(*rev); } return 1; }   non recursion void ReverseString( char* str, int len ) { while( len > 1 ) { swap( &str[0], &str[len – 1] ); ++str; len -= 2; […]

Read More

Questions and answers to some problems in principles of operating systems textbook

Operating System Concept,” 8th edition, Silberschatz, Galvin, Gagne: Wiley, 2008.  1. Textbook page 352, problem 8.11 (memory holes)   Available partitions (holes): 100, 500, 200, 300, 600 (underlined numbers represent the partition being used to fit the request) First-fit algorithm   212                  100, 288, 200, 300, 600 417                  100, 288, 200, 300, 183 112                  100, […]

Read More