From a990295f7e25bf392d2440a75d7fc36fcfb06cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=BE=D1=80=D0=BE=D0=B7=D0=BE=D0=B2=20=D0=90=D0=BD?= =?UTF-8?q?=D0=B4=D1=80=D0=B5=D0=B9?= Date: Tue, 23 Nov 2021 12:53:01 +0000 Subject: [PATCH] source for examples --- tex/dart/flutter.dart | 25 +++++++++++++++++++++++++ tex/dart/hW.dart | 1 + tex/dart/helloWorld.dart | 3 +++ tex/dart/pseudoBFS.txt | 10 ++++++++++ tex/dart/pseudoDFS.txt | 12 ++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 tex/dart/flutter.dart create mode 100644 tex/dart/hW.dart create mode 100644 tex/dart/helloWorld.dart create mode 100644 tex/dart/pseudoBFS.txt create mode 100644 tex/dart/pseudoDFS.txt diff --git a/tex/dart/flutter.dart b/tex/dart/flutter.dart new file mode 100644 index 0000000..9da6b9d --- /dev/null +++ b/tex/dart/flutter.dart @@ -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 [ + Text('Hello World'), + ]), + )), + ); + } +} diff --git a/tex/dart/hW.dart b/tex/dart/hW.dart new file mode 100644 index 0000000..dca84fe --- /dev/null +++ b/tex/dart/hW.dart @@ -0,0 +1 @@ +void main() => print("Hello World"); diff --git a/tex/dart/helloWorld.dart b/tex/dart/helloWorld.dart new file mode 100644 index 0000000..90b58e8 --- /dev/null +++ b/tex/dart/helloWorld.dart @@ -0,0 +1,3 @@ +void main() { + print("Hello World"); +} diff --git a/tex/dart/pseudoBFS.txt b/tex/dart/pseudoBFS.txt new file mode 100644 index 0000000..b627b71 --- /dev/null +++ b/tex/dart/pseudoBFS.txt @@ -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 \ No newline at end of file diff --git a/tex/dart/pseudoDFS.txt b/tex/dart/pseudoDFS.txt new file mode 100644 index 0000000..2b3534d --- /dev/null +++ b/tex/dart/pseudoDFS.txt @@ -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) \ No newline at end of file