Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Queue | Data Structures Part I
Data Structure & Algorithms PART I

bookQueue

OperationBest Time ComplexityAverage Time ComplexityWorst Time ComplexityMemory Complexity
SearchO(1)O(n)O(n)O(1)
InsertionO(1)O(1)O(1)O(1)
DeletionO(1)O(1)O(1)O(1)

FIFO - first input, the first output.

Every day we go shopping. After choosing all products, we need, we go to the box office to pay for our purchases. And there, near the box office, we will meet other people who also decided to go shopping.

In computer programming, the queue is so ideal that the first person in the queue leaves the queue only if the last new customer has become a part of the queue.

The same in the data structure queue.

Enqueue is the process when the new customer becomes the last person in the queue. The process when the first customer leaves the queue is called dequeue.

The problem with the data structure queue is that it can be full. For example, only 10 people can stay near the box office while the rest of the customers must wait until there will be some empty place for them. In computer programming, we can check if the queue isEmpty or IsFull.

Advantage:

  • Slight saving of memory is possible.

Disadvantage:

  • The array size limits the maximum number of elements in the queue.
question mark

What statement is true?

Select the correct answer

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 2

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Suggested prompts:

Запитайте мені питання про цей предмет

Сумаризуйте цей розділ

Покажіть реальні приклади

Awesome!

Completion rate improved to 4.35

bookQueue

Свайпніть щоб показати меню

OperationBest Time ComplexityAverage Time ComplexityWorst Time ComplexityMemory Complexity
SearchO(1)O(n)O(n)O(1)
InsertionO(1)O(1)O(1)O(1)
DeletionO(1)O(1)O(1)O(1)

FIFO - first input, the first output.

Every day we go shopping. After choosing all products, we need, we go to the box office to pay for our purchases. And there, near the box office, we will meet other people who also decided to go shopping.

In computer programming, the queue is so ideal that the first person in the queue leaves the queue only if the last new customer has become a part of the queue.

The same in the data structure queue.

Enqueue is the process when the new customer becomes the last person in the queue. The process when the first customer leaves the queue is called dequeue.

The problem with the data structure queue is that it can be full. For example, only 10 people can stay near the box office while the rest of the customers must wait until there will be some empty place for them. In computer programming, we can check if the queue isEmpty or IsFull.

Advantage:

  • Slight saving of memory is possible.

Disadvantage:

  • The array size limits the maximum number of elements in the queue.
question mark

What statement is true?

Select the correct answer

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 2
some-alt