📘
Grokking-Algorithms book
PostgreSQL
  • Content
  • Introduction to Algorithms
    • Introduction
    • Binary Search
    • Big O notation
    • Recap
  • Selection sort
    • How memory works
    • Arrays and linked lists
    • Selection sort
    • Recap
  • Recursion
    • Recursion
    • Base case and recursive case
    • The stack
    • Recap
  • Quicksort
    • Divide & conquer
    • Quicksort
    • Big O notation revisited
    • Recap
  • Hash tables
    • Hash functions
    • Use cases
    • Collisions
    • Performance
    • Recap
  • Breadth-first search
    • Introduction to graph
    • What is a graph
    • Breadth-first search
    • Implementing the graph
    • Implementing the algorithm
    • Recap
  • Dijkstra's algorithm
    • Working with Dijkstra's algorithm
    • Terminology
    • Trading for a piano
    • Negative-weight edges
    • Implementation
    • Recap
  • Greedy Algorithms
    • The classroom scheduling problem
    • The knapsack problem
    • The set-covering problem
    • NP-complete problems
    • Traveling salesperson, step by step
    • Recap
  • Dynamic programming
    • The knapsack problem
    • Knapsack problem FAQ
    • Longest common substring
    • Recap
  • K-nearest neighbors
    • Classifying oranges vs. grapefruit
    • Building a recommendations system
    • Introduction to machine learning
    • Recap
  • Where to go next
    • Trees
    • Inverted indexes
    • The Fourier transform
    • Parallel algorithms
    • MapReduce
    • Bloom filters and HyperLogLog
    • The SHA algorithms
    • Locality-sensitive hashing
    • Diffie-Hellman key exchange
    • Linear programming
    • Epilogue
  • Answers to exercises
    • Chapter 1
    • Chapter 2
    • Chapter 3
    • Chapter 4
    • Chapter 5
    • Chapter 6
    • Chapter 7
    • Chapter 8
    • Chapter 9
    • Chapter 10
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub

Breadth-first search

Siz yangi, mavhum ma'lumotlar tuzilmasi: grafiklardan foydalangan holda tarmoqni modellashtirishni o'rganasiz.

• Siz "X ga borish uchun eng qisqa yo'l nima?" kabi savollarga javob berish uchun grafiklar ustida ishlashingiz mumkin bo'lgan algoritmni o'rganasiz.

• Yo'naltirilgan va yo'naltirilmagan grafiklar haqida bilib olasiz.

• Siz tugunlar orasidagi bog'liqlikni ochib beruvchi boshqa turdagi tartiblash algoritmini topologik tartiblashni o'rganasiz.

Ushbu bobda grafikalar keltirilgan. Birinchidan, men qanday grafiklar haqida gapiraman (ular X yoki Y o'qlarini o'z ichiga olmaydi). Keyin men sizga birinchi grafik algoritmingizni ko'rsataman. Bu kenglik birinchi qidiruvi (BFS) deb ataladi. Kenglik-birinchi qidiruv ikki narsa orasidagi eng qisqa masofani topish imkonini beradi. Ammo eng qisqa masofa ko'p narsani anglatishi mumkin! Siz kenglikdan birinchi qidiruvdan foydalanishingiz mumkin

  • G'alaba uchun eng kam harakatni hisoblaydigan shashka AIni yozing

  • Imlo tekshirgichni yozing (imlo xatosidan haqiqiy so'zga eng kam tahrirlar - masalan, READED -> READER - bitta tahrir)

  • Tarmoqingizda sizga eng yaqin shifokorni toping

Grafik algoritmlari men bilgan eng foydali algoritmlardan biridir. Keyingi bir necha bobni diqqat bilan o'qib chiqqaningizga ishonch hosil qiling - bu algoritmlar siz qayta-qayta qo'llashingiz mumkin.

PreviousRecapNextIntroduction to graph

Last updated 1 year ago

Was this helpful?

Page cover image