This file contains hidden or 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<cstdio> | |
#include<vector> | |
#define SIZE 2 | |
using namespace std; | |
int main(){ | |
const char *animal[] = {"Dog","Cat"}; |
This file contains hidden or 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<stdio.h> | |
#include<stdlib.h> | |
double f(double c3,double c2,double c1,double c0,double x){ | |
double f = c3*x*x*x + c2*x*x + c1*x + c0; | |
return f; | |
} | |
int main(){ | |
char *poly = "C3*x^3 + C2*x^2 + C1*x + C0"; |
This file contains hidden or 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
Methods of analysis | |
To be able to predict the time without having to look at the details of the input, we measure it as a function of the length of the input. Here x has basically constant length (depending on what an item is) and the length of L is just the number of items in it. | |
So given a list L with n items, how many comparisons does the algorithm take? Answer: it depends. | |
We want an answer that doesn't depend. There are various ways of getting one, by combining the times for different inputs with the same length. | |
Worst case analysis -- what is the most comparisons we could ever see no matter how perverse the input is? | |
time_wc(n) = max time(I) | |
(input I of size n) |
This file contains hidden or 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 os | |
import sys | |
import urllib2 | |
import json | |
import threading | |
import time | |
BING = { | |
"base": "http://bing.com", | |
"wall": "/HPImageArchive.aspx?format=js&idx=0&n=1&nc=1393792328465&pid=hp&video=1" |
This file contains hidden or 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 java.util.*; | |
public class TimeComparer | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner in = new Scanner(System.in); | |
System.out.println("Please enter the first time in military time (hour minute): "); | |
int hour1 = in.nextInt(); |
This file contains hidden or 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
/* | |
* author: bitwiser | |
* for complete tutorial, visit: http://bitwiser.in/2014/04/22/email-google-form-data-as-pdf.html | |
*/ | |
var START_ROW = 2; | |
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<title>BuzzButtons</title> | |
<style> | |
.error{ | |
color: red; | |
} | |
</style> | |
</head> |
This file contains hidden or 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
Cascading Style Sheets (CSS) is a style sheet language used for describing the look and formatting of a document written in a markup language. While most often used to style web pages and interfaces written in HTML and XHTML, the language can be applied to any kind of XML document, including plain XML, SVG and XUL. | |
1. | |
<html> | |
<head><title>1</title></head> | |
<body style="background-image: url('image.jpg')"> | |
Body | |
</body |
This file contains hidden or 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
<?php | |
//Excersice 1 | |
function getextension($file){ | |
$path = pathinfo($file); | |
return $path['extension']; | |
} | |
$music = ""; |
This file contains hidden or 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<stack> | |
#include<queue> | |
using namespace std; | |
bool checkBalancedParentheses(string s){ | |
stack<char> st; | |
for(int i=0;i<s.length();i++){ | |
if(s[i]=='('){ | |
st.push(s[i]); |
NewerOlder