This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Stack_overflow {}; | |
class Stack_underflow {}; | |
class Stack { | |
public: | |
Stack(int sz) : sz{sz}, top{-1}, elem {new int[sz]} {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <map> | |
#include <string> | |
#include <cmath> | |
#include <regex> | |
#include <sstream> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts' ______________________________ ' | |
puts'< What\'s wrong with this food? >' | |
puts' ------------------------------ ' | |
puts' \ ^__^' | |
puts' \ (oo)\_______' | |
puts' (__)\ )\/\'' | |
puts' ||----w |' | |
puts' || ||' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Char (digitToInt) | |
numberToBaseString :: Int -> Int -> String | |
numberToBaseString n base | |
| n < base = show n | |
| otherwise = numberToBaseString ((n - (n `mod` base)) `div` base) base ++ show (n `mod` base) | |
baseStringToValue :: String -> Int -> Int | |
baseStringToValue n base | |
| n == [] = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_max(data): | |
"""Return the maximum element from a nonempty Python list.""" | |
biggest = data[0] | |
for val in data: | |
if val > biggest: | |
biggest = val | |
return biggest |
NewerOlder