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 <stdio.h> | |
#include <string.h> | |
union FloatByteStorage { | |
char bytes[4]; | |
float number; | |
}; | |
int main(int, char**) { | |
FloatByteStorage storage; |
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
Посмотри на площади дым и огни | |
Твоё имя лозунгом новым звучит | |
Сколько б мы не плакали,вас уже нет | |
Кто нам сможет дать ответ? | |
Равнодушных больше нет,время пришло | |
На какой ты стороне:добро или зло? | |
Чтобы мы не сделали вас не вернуть, и на всех один лишь путь. | |
Кто если не я,если не ты | |
Сделает первый шаг для своей страны |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
) |
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
TreeItem findStack(TreeItem root, Object obj) { | |
Deque<TreeItem> stack = new ArrayDeque<TreeItem>(); | |
stack.push(root); | |
while (!stack.isEmpty()) { | |
TreeItem currentItem = stack.pop(); | |
if (Objects.equals(currentItem.getData(), obj)) { | |
return currentItem; | |
} | |
for (TreeItem child : currentItem.getChildren()) { | |
stack.push(child); |
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
TreeItem findStack2(TreeItem root, Object obj) { | |
maxStackSize = 0; | |
Deque<Iterator<TreeItem>> stack = new ArrayDeque<Iterator<TreeItem>>(); | |
stack.push(Collections.singletonList(root).iterator()); | |
while (!stack.isEmpty()) { | |
Iterator<TreeItem> it = stack.peek(); | |
if (it.hasNext()) { | |
TreeItem item = it.next(); | |
if (Objects.equals(item.getData(), obj)) { | |
return item; |
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
package com.company; | |
import java.util.*; | |
import java.util.concurrent.TimeUnit; | |
public class Main { | |
private int n = 100000; | |
private int depth = 0; | |
private int maxStackSize = 0; | |
private int currStackSize = 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
#include <vector> | |
#include <iterator> | |
#include <algorithm> | |
template<typename Iterator> | |
std::vector<typename Iterator::value_type> mergeSort(Iterator begin, Iterator end) { | |
if (begin == end) { | |
return std::vector<typename Iterator::value_type>(); | |
} | |
auto n = std::distance(begin, end); |
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
Boundary = function (value, type) { | |
this.value = value; | |
this.type = type; | |
} | |
Boundary.weightTable = { | |
")": 1, | |
"]": 2, | |
"[": 2, | |
"(": 3 |
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
"use strict"; | |
describe("Test Boundary", function() { | |
var bol0 = new Boundary(0, "("); | |
var bor0 = new Boundary(0, ")"); | |
var bcl0 = new Boundary(0, "["); | |
var bcr0 = new Boundary(0, "]"); | |
var bol1 = new Boundary(1, "("); | |
var bor1 = new Boundary(1, ")"); | |
var bcl1 = new Boundary(1, "["); |
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
for (Job* job: jobs) { | |
for (ComputeNode* node: nodes) { | |
if (node->scheduleJob(job)) { | |
break; | |
} | |
} | |
} |
OlderNewer