Skip to content

Instantly share code, notes, and snippets.

View YassineBajdou's full-sized avatar

Yassine Bajdou YassineBajdou

  • Howdy Code
  • Fes
View GitHub Profile
void selection_sort (int A[ ], int n) {
// temporary variable to store the position of minimum element
int minimum;
// reduces the effective size of the array by one in each iteration.
for(int i = 0; i < n-1 ; i++) {
// assuming the first element to be the minimum of the unsorted array .
minimum = i ;
(function() {
console.log(typeof foo); // function pointer
console.log(typeof bar); // undefined
var foo = 'hello',
bar = function() {
return 'world';
};
fooExecutionContext = {
scopeChain: { ... },
variableObject: {
arguments: {
0: 22,
length: 1
},
i: 22,
c: pointer to function c()
a: 'hello',
fooExecutionContext = {
scopeChain: { ... },
variableObject: {
arguments: {
0: 22,
length: 1
},
i: 22,
c: pointer to function c()
a: undefined,
function foo(i) {
var a = 'hello';
var b = function privateB() {
};
function c() {
}
}
executionContextObj = {
'scopeChain': { /* variableObject + all parent execution context's variableObject */ },
'variableObject': { /* function arguments / parameters, inner variable and function declarations */ },
'this': {}
}
(function foo(i) {
if (i === 3) {
return;
}
else {
foo(++i);
}
}(0));
func factorial(x: Int) -> Int {
// The body of the function goes here...
}
fun factorial(x: Int): Int {
// The body of the function goes here...
}
use std::thread;
use std::sync::mpsc;
fn main() {
let (tx, rx) = mpsc::channel();
for _ in 0..10 {
let tx = tx.clone();
thread::spawn(move || {
let result = 77u32;