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
func bfs(start: String, target: String) { | |
var queue = [start]; | |
while let node = queue.popLast() { | |
} | |
} |
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
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) | |
} |
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
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) |
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
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; |
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
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; |
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
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)) |
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
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))) |
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
.scale(scale: 0.5) | |
.offset(y: 30) | |
.move(edge: .leading) |
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
.scale(scale: 0.5) | |
.offset(y: 30) | |
.move(edge: .leading) |
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
let insertion = AnyTransition.move(edge: .trailing).combined(with: .opacity) | |
let removal = AnyTransition.scale.combined(with: .opacity) | |
RingView().transition(.asymmetric(insertion: insertion, removal: removal)) |
NewerOlder