source for examples
This commit is contained in:
parent
f295e933be
commit
a990295f7e
|
@ -0,0 +1,25 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Flutter Demo',
|
||||
home: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Flutter Demo'),
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const <Widget>[
|
||||
Text('Hello World'),
|
||||
]),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
void main() => print("Hello World");
|
|
@ -0,0 +1,3 @@
|
|||
void main() {
|
||||
print("Hello World");
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
BFS(G, s):
|
||||
queue Q
|
||||
s <- visited
|
||||
Q.add(s)
|
||||
while (Q.not_empty):
|
||||
u = Q.pop
|
||||
for a in u.connections:
|
||||
if a is unvisited:
|
||||
Q.add(a)
|
||||
a <- visited
|
|
@ -0,0 +1,12 @@
|
|||
function doDfs(G[n]: Graph):
|
||||
visited = array[n, false]
|
||||
|
||||
function DFS(u: int):
|
||||
visited[u] = true
|
||||
for v: (u, v) in G:
|
||||
if not visited[v]:
|
||||
DFS(v)
|
||||
|
||||
for i = 1 to n:
|
||||
if not visited[i]:
|
||||
DFS(i)
|
Loading…
Reference in New Issue