代码改变世界

阅读排行榜

Find min elements in the Stack

2010-09-25 19:46 by wansishuang, 251 阅读, 收藏,
摘要: Implement a stack which supports FindMin(),push() and pop(). The probability of the occurrence is equal.Maintain two stacks. In 1st, maintain the values in order of their push event. while in 2nd stac... 阅读全文

reverse a stack in place using recursion

2010-10-02 23:09 by wansishuang, 235 阅读, 收藏,
摘要: Write a C Program to reverse a stack in place using recursion. You can only use the following ADT functions on stack: IsEmpty, IsFull, Push, Pop, Topyou can not use extra stack or any other data struc... 阅读全文

矩阵转换

2010-10-02 22:46 by wansishuang, 231 阅读, 收藏,
摘要: You are given a rectangular matrix with odd numbers of rows and columns. Each cell of the matrix contains either 0 or 1. In one move, you can select any one row or column of the matrix and replace all... 阅读全文

calculate the size of the new type

2010-10-02 23:14 by wansishuang, 228 阅读, 收藏,
摘要: You are given have a datatype, say X in C. Determine the size of the datatype,without declaring a variable or a pointer variable of that type, and, of course without usingthe sizeof operator! 阅读全文

sort a stack

2010-10-03 21:55 by wansishuang, 221 阅读, 收藏,
摘要: Given a stack S, write a C program to sort the stack (in ascending order).You are not allowed to make any assumptions about how the stack is implemented; the only functions allowed to be used are: Pus... 阅读全文