<commit_before>package src.main.java.ru.abashlykov.task;

import java.util.LinkedList;

public class PriorityQueue {
    private LinkedList<Task> tasks = new LinkedList<>();

    public void put(Task task){

        if(tasks.isEmpty()){
            tasks.add(task);
        } else if (!tasks.isEmpty()){
            for(Task element : tasks){
                if(element.getPriority() > task.getPriority()){
                    tasks.add(element.getPriority(), task);                }
            }
        }


    }

    public Task take(){
        return this.tasks.pollFirst();
    }


}<commit_msg>2. Очередь с приоритетом на LinkedList [#41670](главное помнить о break)<commit_after>package src.main.java.ru.abashlykov.task;

import java.util.LinkedList;

public class PriorityQueue {
    private LinkedList<Task> tasks = new LinkedList<>();

    public void put(Task task) {
       if(tasks.isEmpty()){
           tasks.add(0, task);
       } else {
           for(Task element : tasks){
               if(element.getPriority() > task.getPriority()){
                   int numberOfElement = tasks.indexOf(element);
                   tasks.add(numberOfElement, task);
                   break;
               }
           }
       }
    }

    public Task take(){
        return this.tasks.poll();
    }
}


{'fraction_non_alphanumeric': 0.12185833968012186, 'fraction_numerical': 0.005331302361005331, 'mean_word_length': 1.87527352297593, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1465263', 'n_tokens_mistral': 389, 'n_tokens_neox': 367, 'n_words': 78}