59 Computer Science ideas in 2026 | computer science, science, python
Skip to content
When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.

Computer Science

59 Pins
·
2 Sections
·
1mo
ostad.ai
By
ostad.ai
The log-sum-exp trick is a numerical technique to compute log⁡∑_i exp(a_i)​ without overflow/underflow.  The so called log-sum-exp trick shifts every exponent of the exponential term by their maximum. This simple transformation makes the log-sum-exp computation numerically stable.
Here, we bring the formulae and the Python code to test the trick.
The Python code is also available at the mentioned GitHub page:
 https://github.com/ostad-ai/Computer-Science
Determinant of a square matrix reveals some properties of the matrix. Here, the Laplace expansion is mentioned along some properties of determinant. Also, minors and cofactors are expressed, and how to compute the inverse of the matrix by its adjugate. The complete Python code is at the mentioned GitHub page.
The trace of a matrix is defined for square matrices. The trace is the sum of the elements on the main diagonal of the matrix. We review some properties of trace with Python code. The complete code is at the mentioned GitHub page.

Background Knowledge

16 Pins
Disjoint-set (or union-find) data structure is a data structure that works with disjoint (non-overlapping) sets. It has two main operations: union and find. Union merges two sets. Find determines the set that an element belongs to.
Here, we implement this data structure in Python. Then, we test it with an example. As a bonus, we use union-find for friend groups in social networks.
The complete Python code is available at the mentioned GitHub page.
https://github.com/ostad-ai/Computer-Science
A priority queue is an abstract data type similar to queue such that each element has a priority attached to it. Elements with higher priority are served (processed) before elements with lower priority. If two elements have the same priority, they are served in the order they were added (FIFO), although this behavior can vary.
Here, we implement priority queues with module heapq. We also show how to use module queue for priority queue.
The complete Python code is available at the mentioned GitHub page.
https://github.com/ostad-ai/Computer-Science
A queue is a linear data structure that follows the FIFO (First In, First Out) principle. It means that the first element added to the queue will be the first element to be removed.  We can think of queue like a line at a grocery store.
Here, we review the queue and implement it with three different methods in Python. At the end, we compare their performance.
The whole Python code is available at the mentioned GitHub page:
https://github.com/ostad-ai/Computer-Science

Algorithms and Python Codes

43 Pins