Skip to content

Instantly share code, notes, and snippets.

View Gavin0x0's full-sized avatar
🍄
No mushroom!

Gavin Gavin0x0

🍄
No mushroom!
View GitHub Profile
// 已知数组 A[1··n]的元素类型为整型 int,设计一个时间和空间上尽可能高效的算法
// 将其调整为左右两部分,左边所有元素为奇数,右边所有元素为偶数,不要求对这些元素排序
// (1) 给出算法的基本设计思想:
// (2) 根据设计思想,采用 c 语言表述算法,关键之处给出注释:
// (3) 说明你所设计算法的时间复杂度和空间复杂度。
#include <iostream>
#include <vector>
#include <random>
using namespace std;
@craiglabenz
craiglabenz / chat_message_render_box.dart
Last active October 19, 2024 17:28
Demonstrates a custom RenderObject that draws chat messages like WhatsApp, where the `sentAt` timestamp is tucked into the last line if it fits
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@Gavin0x0
Gavin0x0 / main.dart
Created October 17, 2022 16:21
zealous-lantern-8672
import 'dart:convert';
import 'dart:math';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() => runApp(const MyApp());