#bubblesort
Explore tagged Tumblr posts
fortunatelycoldengineer · 9 months ago
Text
Tumblr media
Tim Sort Algorithm . . . . Explore this essential Data structure and Algorithm! It covers key topics and resources for every tech enthusiast from algorithms to Data Structure. Perfect for learning and growth. Let's connect and innovate together! Check the link below: https://bit.ly/443TDU4
0 notes
snaildotexe · 2 years ago
Text
Software Technical Interview Review List
Data Structures
Arrays (and Java List vs ArrayList)
String
Stack
Queue
LinkedList
Algorithms
Sorting (Bubblesort, Mergesort, Quicksort)
Recursion & Backtracking
Linear and Binary Search
String/Array algos
Tree traversal
Dynamic Programming
Graph algos (DFS, BFS, Dijksta's and Kruskals)
OOP fundamentals
Polymorphism
Inheritance
Encapsulation
Data abstraction
SOLID and GRASP
Explanations & example questions:
Strings and Arrays [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ]
Stacks and Queues [ 1 | 2 ]
LinkedList [ 1 | 2 ]
Sorting & searching [ 1 | 2 | 3 | 4 | 5 | 6 | 7 ]
Recursion and Backtracking [ 1 | 2 | 3 | 4 ]
Dynamic Programming [ 1 | 2 | 3 | 4]
Graphs [ 1 | 2 | 3 ]
Tree [ 1 | 2 ]
General DS&A info and questions [ 1 | 2 | 3 | 4 | 5 ]
OOP review & questions [ 1 | 2 | 3 ]
20 notes · View notes
techsoundwave · 1 month ago
Text
Как улучшить производительность кода: лучшие практики
Как разработчик, работающий в стартапе и создающий инновационные мобильные приложения, я прекрасно понимаю, как важно не только создавать функциональный и красивый продукт, но и делать его максимально производительным. Быстрые и отзывчивые приложения привлекают больше пользователей и создают лучшие условия для продвижения сайтов и приложений. В этой статье я хочу поделиться с вами несколькими лучшими практиками, которые помогут улучшить производительность вашего кода.
1. Оптимизация алгоритмов
Основой высокой производительности является правильный выбор алгоритмов. Перед тем как приступить к разработке, всегда стоит проанализировать, какой алгоритм будет наиболее эффективным для решения поставленной задачи. Например, в случае сортировки данных используйте быстрые алгоритмы сортировки, такие как QuickSort или MergeSort, а не простые O(n^2) методы, такие как BubbleSort. Подобный выбор поможет сократить время работы программы и ускорить её выполнение.
2. Использование кеширования
Кеширование — это важная техника, позволяющая значительно ускорить работу приложения, особенно если оно часто выполняет одинаковые операции или обращается к данным, которые не изменяются часто. Вы можете кешировать результаты запросов к базе данных, веб-ресурсов, или сложных вычислений, чтобы избежать их повторного выполнения.
Для мобильных приложений, например, можно использовать локальное кеширование с помощью SQLite или встроенных решений для хранения данных. Веб-приложения часто используют кеширование на сервере или на уровне CDN, что сокращает время загрузки страниц и ускоряет доступ к информации.
3. Параллелизм и многозадачность
Использование параллельных вычислений и многозадачности помогает значительно улучшить производительность. Современные процессоры обладают множеством ядер, и если ваш код может быть разделён на независимые задачи, это позволяет использовать все возможности процессора.
В мобильных приложениях многозадачность особенно важна, когда приложение выполняет несколько действий одновременно, например, загрузку данных, обработку изображений или работу с API. Использование таких инструментов, как асинхронные задачи и многозадачные потоки, позволяет эффективно распределять нагрузку и минимизировать задержки.
4. Минимизация использования памяти
Эффективное использование памяти — это ещё один важный аспект улучшения производительности кода. Постоянное выделение и освобождение памяти может замедлить работу приложения, особенно в случае работы с большими объёмами данных. Важно избегать утечек памяти, а так��е минимизировать создание лишних объектов и массивов.
Для мобильных приложений это особенно важно, так как устройства имеют ограниченные ресурсы. Профилирование памяти и использование таких инструментов, как Android Profiler или Xcode Instruments, помогут выявить проблемные места и улучшить использование памяти.
5. Оптимизация работы с базами данных
Если ваше приложение активно взаимодействует с базой данных, важно оптимизировать запросы. Используйте индексы для ускорения поиска, избегайте сложных объединений (JOIN) в запросах и старайтесь минимизировать количество обращений к базе данных. Кроме того, стоит обратить внимание на кэширование запросов и использование транзакций, чтобы избежать лишних операций.
Для мобильных приложений с офлайн-режимом можно использовать решения, такие как Realm или SQLite, которые позволяют эффективно работать с локальными базами данных.
6. Сжатие и оптимизация ресурсов
Для веб-приложений и мобильных приложений одним из важных аспектов производительности является оптимизация ресурсов, таких как изображения, скрипты и стили. Сжатие изображений без потери качества, минификация JavaScript и CSS, а также использование современных форматов изображений, таких как WebP, могут значительно ускорить загрузку страниц и повысить отзывчивость приложения.
Сжатие данных и использование CDN для доставки ресурсов также помогут уменьшить нагрузку на сервер и ускорить загрузку для пользователей по всему миру.
7. Профилирование и мониторинг
Никакая оптимизация не будет эффективной, если вы не измеряете результаты. Использование инструментов профилирования и мониторинга — это ключевой шаг на пути к улучшению производительности. Профилировщики, такие как Android Profiler, Xcode Instruments или Chrome DevTools, помогут вам обнаружить узкие места в вашем коде и оперативно их устранить.
Для веб-приложений можно настроить инструменты мониторинга, такие как Google Analytics или New Relic, чтобы отслеживать производительность в реальном времени и выявлять возможные проблемы, которые могут замедлять приложение.
8. Инкрементальные обновления
Наконец, для успешного продвижения сайта или мобильного приложения важно не только улучшить производительность, но и оперативно обновлять функционал. Чем быстрее вы внедряете новые фичи или исправления ошибок, тем быстрее получаете обратную связь от пользователей и можете улучшить продукт.
Инкрементальная разработка и использование CI/CD-процессов для автоматической сборки и развертывания новых версий помогают ускорить этот процесс и сделать его более предсказуемым.
Tumblr media
Улучшение производительности кода — это не разовый процесс, а постоянная работа. Оптимизация алгоритмов, эффективное использование памяти, кеширование и правильная работа с базами данных — это лишь часть практик, которые помогут сделать ваше приложение более быстрым и отзывчивым. В условиях высокой конкуренции, особенно в стартапах, где время имеет значение, высокая производительность — это не только вопрос удобства пользователя, но и фактор, влияющий на успешное продвижение сайтов и приложений.
0 notes
codingprolab · 1 month ago
Text
ESOF 322: Software Engineering I Homework 3
In this assignment, you are to design, then implement a program in Java (or your OO language of choice) that uses the Strategy pattern to solve the following problem. You would like to provide a system for your customer that allows them to choose any one of three types of sorting algorithms (bubbleSort, mergeSort, insertionSort, quickSort, etc.). Each of these sort algorithms provides a function…
0 notes
programmingandengineering · 2 months ago
Text
Bubble Sort, Insertion Sort, Merge Sort, Quick Sort, Shell Sort
Description: You will write a program which implements the following sorts and compares the performance for operations on arrays of integers of growing sizes 10, 100, 1000, 5000, 10000, 25000, etc…. You will graph the performance of the different sorts as a function of the size of the array. 1)BubbleSort 2)InsertionSort 3)MergeSort 4)Non-Recursive, one extra array MergeSort (We’ll call this…
0 notes
adayiniilm · 6 months ago
Text
Data Structure and Algorithms:A brief
Computer science's foundational subject of data structures and algorithms (DSA) is concerned with the management, processing, and organization of data.
Crucial Ideas: Data Structures:
An array is a group of items that are identified by an index. Linked lists are collections of items that all point to one another. Stacks: LIFO structure for element addition and deletion. FIFO structures for processing elements are called queues. Trees: Nodes in a hierarchical structure (e.g., binary trees). A graph is an arrangement of nodes joined by edges. Computer programs:
Quicksort, mergesort, and bubblesort are examples of sorting techniques. Binary search and linear search are examples of search techniques. Recursion: The ability of functions to solve problems by calling themselves. In order to maximize solutions, dynamic programming divides problems into smaller ones. Relevance: Knowledge of DSA is essential for effective coding, problem-solving, and is frequently emphasized in technical interviews.
https://www.iilm.edu
0 notes
ketbra · 1 year ago
Note
sorry to bring up ancient history from mid-October, but someone who codes using AI tools IS a programmer, just like someone who uses them for art is an artist. Most programmers learned to code by copying other people’s code piecemeal, maybe tweaking the parts they could figure out until it did what they wanted, and it doesn’t make any difference if they get the code from an AI instead. People cribbing from Stack Overflow are programmers, people who code with those building-block UIs are programmers, people who write basic bash scripts for the commandline are programmers, people arranging machine instructions in binary are programmers. Do you see? They’re all creating. Where would we be if we had stopped at punchcards because typing a program was too easy? However easy we make it, there will still be further goals to strive for. (Also, anyone who claims you need to know bubblesort to be a programmer is a fool and probably a poser.)
Hi anon, I'm actually glad my posts from mid-october don't get read and forgotten and i really appreciate the question because I don't think this website has enough middle ground on the topic to have a conversation that isn't just hate from both sides.
So, I get where you're coming from, there are many different types of programmers and there are many different types of artists, and it's true that not all of them know bubblesort because maybe some programmers kept on working and developing other aspects (an assembly programmer and an html developer have surely different views on the same topic)
and it's so very much true that you can find code on stack overflow, or directly ask chatgpt for a function and you can add those strings to your code. or you can use tools for building the UI all you want
but there is a difference between asking AI tools for a piece of code and knowing how it works. You can have a completely working program or app that you ask AI to code for you and you might have the idea for that app, but if you don't know how the code works then you're not the one who programmed it. And I don't mean it to minimize anyone's work, but if one reads a piece of code, (with all the context needed to understand it) and doesn't know how it works, then that person isn't a programmer.
I'm not saying different types of developers need to know everything about every language, but they do know the one they're using.
The difference between copying a piece of code into your code and getting the code completely written by someone/something else is that in the first instance you know what you're doing and you're asking for help, in the second you're commissioning a final product.
And I think this can be applied to art as well, an artist knows so many things we take for granted, the pressure, how light and shadows work, anatomy, prospective, materials, contrast, which color evokes that specific emotion and so on.
Now, is every draw painted by a real person art? (tumblr is going to hate me for this but) no, not every draw is art, there's always a subjective element in these discourse but personally I don't think everything is art, or that everything is a ode to the human condition, sometimes one draws a doodle and it's fun and doesn't hold the weight of being called art.
Is every draw painted by AI shit? (and tumblr is going to hate me for this as well but) no. sometimes AI art is wonderful and sometimes it's just fun, I use it with friends, we make silly pictures to send eachother and birthday cards. and it's fun, and pretty and we're all programmers and it's harmless.
And the thing is, that I am pro AI-art just not in the way it is now. I think the scraping of every picture on the internet to train AIs has been a little invasive and kind of unfair. I think the best way to get AI tools and human artists together is to have AI trained on every classical painting and draw at museums and in history books, and then, if there are specific modern styles a company selling AI tools wants to add to its portfolio then they should get in contact with said artists and pay them for their work and ask permission to use their art.
the way I see it, it's like if you made a funny post on the internet, and a company copies and pastes it on their own profile and makes it look like it was its pr team who thought about it. And I mean they don't get anything directly out of it, but also there's a value in the image a company has online.
I think this answer is very long already and I just want to finish it with the actual answer to the question. I don't think AI artists can call themselves that. I don't think they're artists, they're for sure creative people and they can have good, great, ideas like everyone one else but if they don't have the knowledge to create those pieces on their own then they're not artists. Designers, picture architects, prompt makers, people with great ideas but not artists.
And before you tell me yeah but you still need some tools to make art, you can't not do it "on your own", yes but there's a difference between drawing with an ipad and typing a prompt into mid-journey.
You could end up with the same exact result and people might not even recognize one is AI but it's not the same thing as being an artist.
I can design a wool hat to the detail, but that makes me a designer, not a knitter. BUT those figures can and do collaborate, it's just that in this very moment AI tools aren't making it possible to have a conversation. they stole from the world wide web and they did it for profit. and it always ends up like this, it's always a marketing tool.
0 notes
softwarily · 1 year ago
Text
1 note · View note
ketbra · 2 years ago
Text
I'm but a humble programmer but if you want to shut up a tech bro for real ask them if someone who never once wrote a line of code alone in their life is a programmer if they ask chatgpt for coding. Ask them if they'd agree with someone calling themselves ai-programmer if they don't know classes or malloc or bubblesort or pointers or this or constructors. "but my code works" 'yes, but you don't know how or why'
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
FireflySummers’ Guide to Arguing Against the Use of AI Image Generators
(AKA I hate AI image generators so fucking much that I published a whole ass academic article on it)
Read the Paper: Art in the Machine: Value Misalignment and AI "Art"
Citation: Allred, A.M., Aragon, C. (2023). Art in the Machine: Value Misalignment and AI “Art”. In: Luo, Y. (eds) Cooperative Design, Visualization, and Engineering. CDVE 2023. Lecture Notes in Computer Science, vol 14166. Springer, Cham. https://doi.org/10.1007/978-3-031-43815-8_4
The purpose of the original paper and now this post is the following:
Provide at least one academic article that you can cite. (Full paper + citation available below)
Make explicit community values that have previously been implicit, in order to better examine your own perceptions of the online artist community, and where you sit within it.
Provide rebuttals to common pro-AI talking points, with the intention of shutting down the conversation and reclaiming the narrative. 
What this paper and post cannot do:
Act as a sole authority about the online artist community and its values. We are not a monolith, and it is up to you to think critically about what, exactly, you want to take away from this discussion.
Provide a way to convince AI Evangelists that what they’re doing is wrong and bad and needs to stop. You will never convince them. Again, focus on shutting them down and reclaiming the narrative.
Final Disclaimer: I'm a very fallible researcher who is still very much learning how to do academia. I cannot speak for the entirety of the online artist community or fanartist community. We all have different lived experiences. I have done my best to include diverse voices; however if you have concerns or critiques, I am open to hearing them.
If you show up to debate in favor of AI image generators, you will be automatically blocked.
Credits:
Editors, Meme Experts, and Annotators: @starbeans-bags, @b4kuch1n, @cecilioque.
Tutorial Examples: @sabertoothwalrus, @ash-and-starlight, @miyuliart, @hometownrockstar, @deoidesign, @cinnamonrollbakery
If you have read this far, thank you very much. I hope that you have found a constructive lens for approaching the war with AI image generators, as well as a new tool for shutting down debate and reclaiming the narrative.
3K notes · View notes
fortunatelycoldengineer · 9 months ago
Text
Tumblr media
Shell Sort Algorithm . . . . Explore this essential Data structure and Algorithm! It covers key topics and resources for every tech enthusiast from algorithms to Data Structure. Perfect for learning and growth. Let's connect and innovate together! Check the link below: https://bit.ly/4jHcrNq
0 notes
thatnoulguyorsomething · 1 year ago
Text
Currently trying to write a bubblesort algorithm in Befunge, which is pretty much the level of weird that I should've expected to be doing on the weekend before crimsas
0 notes
emarezi-backup · 1 year ago
Text
"this is how to do a bubblesort algorithm" can you take me out on the back and fucking shoot me
0 notes
hackernewsrobot · 2 years ago
Text
FreeBSD replaces bubblesort with mergesort on SYSINTs
https://twitter.com/cperciva/status/1693127769901969772
0 notes
arpit143blog · 2 years ago
Text
Java program that performs bubble sort on an array of integers:
javaCopy codepublic class BubbleSort { public static void main(String[] args) { int[] numbers = {7, 2, 9, 1, 5}; System.out.println("Before sorting:"); printArray(numbers); bubbleSort(numbers); System.out.println("After sorting:"); printArray(numbers); } public static void bubbleSort(int[] numbers) { int n = numbers.length; boolean swapped; for (int i = 0; i < n - 1; i++) { swapped =…
View On WordPress
0 notes
nuxillu · 2 years ago
Text
Tumblr media
Rembrandt. Mann mit Goldhelm. Mar 2023
Ich bild mir ja ein, die Algorithmen zu kennen, nach denen linke Hirne sich die Welt sortieren. Ich sag nur "Bubblesort". Trotzdem sollte man sie nicht unterschätzen, die Internationalsozialisten.
Wir haben zugelassen, daß sie alle strategisch wichtigen Punkte besetzen konnten. Haben kuhäugig zugesehen, wie sie in den Medien, in der Justiz, in den "Ethikräten" ihre MG-Nester aufbauen und mit Ringmauern aus Aktivisten-Sandsäcken befestigen.
Und natürlich habe ich nach der Pandemie vorausgesehen, was als nächstes kommt: Der nächste Notstand nämlich. Im speziellen Fall die Lauterbach'sche Todeshitze. Könnte aber auch "katastrophal hohe Vermehrungsraten in der Feldhamster-Population" oder "Neue Pandemie. Tapirschwanzschnupfen. Schon hunderte infiziert" sein.
Hab ich mir gleich einen Tropenhelm besorgt, damit ich auch diesen Notstand gut überstehe.
Meine Voraussage? Wir werden von einem "Notstand" in den nächsten stolpern. Jeder neuerliche Notstand wird von der höfischen Schranzen-Clique in Berlin dazu genutzt werden, den Polizeistaat weiter auszubauen.
Und die Feme-Gerichte unter den internationalsozialistischen Ting-Eichen* werden jeden zum Tode verurteilen, der nicht täglich vor dem tausendjährigen Gender-Führer salutiert. Ich zitiere: "Kill Till".
In hundert Jahren dann wird die Jugend sich fragen, wieso niemand etwas unternommen hat, damals. Werden sich junge Menschen zutiefst dafür schämen, daß Opa beim Tagesspiegel gearbeitet und die ganze Familie, bis runter ins fünfte Glied, mit seiner Propagandascheiße besudelt hat. Und man wird Reparationen fordern von Tagesspiegel- und Zeit-Redakteurs-Nachkommen.
---
Nee, das is kein AI-Bildchen. Der Helm liegt hier rum. Katholiken haben immer einen gewissen Fundus an Masken und Hütchen am Start. Wir sind die Erfinder des Karnevals und des schlechtgeschminkten Trans-ID-Zirkus. Inkl. geschmacklosem Ohrschmuck. Denn die wichtigste Regel im Karneval lautet: Nicht hübsch, sondern bescheuert. So wie bei unseren Nachahmern von der Transifa-Front.
---
* Ich erzähl wieder Blödsinn. Schreibt sich Thing und nicht Ting. Und es waren Linden, unter denen die Vorfahren des linken, des internationalsozialistischen Mobs sich versammelten. https://de.wikipedia.org/wiki/Thing
0 notes
programmingandengineering · 2 months ago
Text
Bubble Sort, Insertion Sort, Merge Sort, Quick Sort, Shell Sort
Description: You will write a program which implements the following sorts and compares the performance for operations on arrays of integers of growing sizes 10, 100, 1000, 5000, 10000, 25000, etc…. You will graph the performance of the different sorts as a function of the size of the array. 1)BubbleSort 2)InsertionSort 3)MergeSort 4)Non-Recursive, one extra array MergeSort (We’ll call this…
0 notes