Skip to content

Instantly share code, notes, and snippets.

View Arrlindii's full-sized avatar

Arlind Aliu Arrlindii

  • Munich, Germany
View GitHub Profile
func bfs(start: String, target: String) {
var queue = [start];
while let node = queue.popLast() {
}
}
func bfs(start: String, target: String) {
var queue = [start];
while let node = queue.popLast() {
let children = adjacencyList[node]!;
for movie in children {
if (movie == target) {
print("TARGET MOVIE FOUND-" + target)
}
func bfs(start: String, target: String) {
var visitedNodes = [String]();
var queue = [start];
while let node = queue.popLast() {
let children = adjacencyList[node]!;
for movie in children {
if (movie == target) {
print("TARGET MOVIE FOUND-" + target)
func dfs(start: String, target: String) -> Bool{
visitedNodes.append(start)
print(start)
let directNodes = adjacencyList[start]!
for node in directNodes {
if node == target {
print("found the target movie: \(target)")
return true;
func dfs(start: String, target: String) -> Bool{
visitedNodes.append(start)
print(start)
let directNodes = adjacencyList[start]!
for node in directNodes {
if node == target {
print("found the target movie: \(target)")
return true;
import Foundation
import SwiftUI
struct GradientCircle: View {
var body: some View {
let color1 = Color.init(red: 81/255, green: 204/255, blue: 159/255)
let color2 = Color.init(red: 154/255, green: 255/255, blue: 248/255)
let spectrum = Gradient(colors: [ color1, color2])
let conic =
LinearGradient(gradient: spectrum, startPoint: UnitPoint(x: 0, y: 0.5), endPoint: UnitPoint(x: 0.5, y: 1))
FlowerAnimatableView(sides: 6,size: 65,scale: 1.0)
.frame(width: 65, height: 65)
.transition(AnyTransition.scale(scale: 0.3)
.combined(with: .offset(x: 100, y: 200)))
.animation(Animation.easeInOut(duration: animationTime))
LabelView()
.animation(Animation.easeInOut(duration: animationTime).delay(animationTime/2))
.transition(AnyTransition.opacity.combined(with: .offset(x: 0, y: 80)))
.scale(scale: 0.5)
.offset(y: 30)
.move(edge: .leading)
.scale(scale: 0.5)
.offset(y: 30)
.move(edge: .leading)
let insertion = AnyTransition.move(edge: .trailing).combined(with: .opacity)
let removal = AnyTransition.scale.combined(with: .opacity)
RingView().transition(.asymmetric(insertion: insertion, removal: removal))