Skip to content

Instantly share code, notes, and snippets.

/* selection problem solution in C*/
#include<stdio.h>
/*swap two elements*/
void swap(int *a,int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
/* Implementaion of quicksort in C*/
#include<stdio.h>
/*swap two elements*/
void swap(int *a,int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
#include<stdio.h>
/*copy two arrays*/
void copyArray(int readFrom[], int begin, int end, int writeTo[])
{
int i=0,j=begin;
while(i<end-begin+1)
{
writeTo[i] = readFrom[j];
i++;
/* insertion sort implementation in C */
#include<stdio.h>
/* swapping two elements by reference */
void swap(int *a,int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
/* selection sort implementation in C */
#include<stdio.h>
/* swapping two elements by reference */
void swap(int *a,int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
/* Bubble sort implementation in C */
#include<stdio.h>
/* swapping two elements by reference */
void swap(int *a,int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
var mycanvas =document.getElementById("mycanvas");
var ctx=mycanvas.getContext("2d");
var w=500,h=500;
//canvas styles
mycanvas.height=h;
mycanvas.width=w;
//balls array
var ball=[];
//Class for ball
<html>
<head>
<style>
#mycanvas {
display: block;
border: 5px solid green;
margin: 50px auto;
}
</style>
</head>
#!/usr/bin/python
import mechanize
import itertools
br = mechanize.Browser()
br.set_handle_equiv(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)
#!/usr/bin/python
import mechanize
import itertools
br = mechanize.Browser()
br.set_handle_equiv(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)