Let's say my algorithm returns many layers and I need to insert those layers into the specific index in layer list, while running algorithm.
QgsProject.instance().layerTreeRoot() worked in QGIS 2 and I could change layers indexes as described in QGIS Layer Tree API (Part 2), while Processing algorithm was running.
How can I do the same thing in QGIS 3 Processing script?
I took a glance at QgsProcessingAlgorithm Class Reference. There are some functions like parameterAs****(). I thought one of them could help me. But I couldn't find useful function. I can get layer, layer list, crs etc. by means of some. But I can't get the layer tree (layerTreeRoot) or the project (QgsProject) reference.