This file contains hidden or 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
from __future__ import annotations | |
from collections.abc import Iterable | |
from dataclasses import dataclass | |
from typing import Any | |
class Deque: | |
""" | |
Структура данных дек. | |
Методы |
This file contains hidden or 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
public class DiningPhilosophers { | |
public static void main(String[] args) throws Exception { | |
final Philosopher[] philosophers = new Philosopher[5]; | |
Object[] forks = new Object[philosophers.length]; | |
for (int i = 0; i < forks.length; i++) { | |
forks[i] = new Object(); | |
} |