Skip to content

Instantly share code, notes, and snippets.

View duyet's full-sized avatar

duyet duyet

View GitHub Profile
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)
/*!
* Bootstrap v3.1.1 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;heigh
/* lazyload.js (c) Lorenzo Giuliani
* MIT License (http://www.opensource.org/licenses/mit-license.html)
*
* expects a list of:
* `<img src="blank.gif" data-src="my_image.png" width="600" height="400" class="lazy">`
*/
!function(window){
var $q = function(q, res){
if (document.querySelectorAll) {
void quickSort(int left, int right)
{
int i, j, x;
i = left;
j = right;
x = mang[(j + i) / 2];
do {
while (mang[i++] < x); i--;
while (mang[j--] > x); j++;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
struct node{
int key;
node *left, *right;
void listselectionsort(list &l)
{
node*p,*q,*min;
p=l.phead;
while(p!=l.ptail)
{
min=p;
q=p->pnext; // sai p=p->pnext;
while(q!=NULL)
# include<iostream>
using namespace std;
struct data
{
int so;
};
struct node
{
data info;
node*pnext;
/**
* Data structure and algorithm: Binary Tree
* Some action with Binary Tree
*
* Author: LvDuit (lvduit08 at gmail.com)
* Date: 16/06/2014
*/
#include <stdio.h>
#include <math.h>
@duyet
duyet / printNodeWithHeightLeftEqualRight.cpp
Created June 19, 2014 11:25
Xuất những nút có chiều cao nhánh trái bằng chiều cao nhánh phải
int max(int a, int b) {
return (a > b) ? a : b;
}
int getHeight(TREE T) {
if (T == NULL) return 0;
return 1 + max(getHeight(T->left), getHeight(T->right));
}
@duyet
duyet / reverse_single_list.cpp
Created June 21, 2014 15:13
Đảo danh sách liên kết đơn
// list action
inline void reverse(LIST * L) {
NODE * next;
NODE * curr = L->head;
NODE * prev = NULL;
while (curr != NULL) {
next = curr->next;
curr->next = prev;