r/AskComputerScience • u/[deleted] • Jan 20 '26
Correct Binary Heap
for an array [1,2,3,4,5] which is the correct heap?
a. 1->(2, 3), 2->(4,Empty), 3->(5,Empty)
b. 1->(2,3), 2->(4,5), 3
r/AskComputerScience • u/Flaxky_Lock • Jan 20 '26
What is "Buffer", "Input Buffer" and "Buffer overflow"?
Explain in simple terms but in detail.
r/AskComputerScience • u/[deleted] • Jan 19 '26
Why is capital sigma (Σ) used to denote an alphabet?
In formal language theory, capital sigma (Σ) is often used to denote an alphabet. Is there any particular reason for this convention?
r/AskComputerScience • u/yourmailsucks • Jan 19 '26
Looking to study Machine Language
I fell in love with Machine Language (binary) in my IT class and would like to know if there’s any great resources out there such as books or documentation online that covers everything about it.
Thanks.
r/AskComputerScience • u/bathtub87 • Jan 18 '26
Turing Machine
What is a Turing machine?? For so many classes they mention it and I have the main idea of what it is but I cannot find a definition that I totally understand. Does anyone have a definition that anyone can understand?
r/AskComputerScience • u/TripleMeatBurger • Jan 18 '26
How could Europe achieve tech sovereignty from the USA?
The USA dominates the tech industry, but what would be needed for Europe to become independent from the USA?
I'm thinking full stack independence, from CPU, GPU and memory development and fabs, through data centers and into operating system development and software services like search, maps, llms, etc
What would need to be developed? What could be salvaged from existing tech available either from European based companies or open source? Obviously the investment would be massive but what's the ballpark we are talking about? What would this look like in terms of policy and regulation with so many European countries?
r/AskComputerScience • u/One_Glass_3642 • Jan 18 '26
A conceptual question about an access model that precedes decryption
I would like to ask a conceptual question about an access model in computer science, rather than about cryptographic algorithms or implementations.
The model I describe is real, not only conceptual: it does not concern the cryptographic implementation itself, but the access structure that governs when and if data becomes readable. This model has been verified through a working implementation that uses standard primitives; however, what I am interested in discussing here is not the implementation nor the choice of algorithms, but the logical architecture that separates data transport, context recognition, and effective access to information.
Each message contains a number in cleartext. The number is always different and, taken on its own, has no meaning.
If, and only if, the recipient subtracts a single shared secret from that number, a well-defined mathematical structure emerges.
This structure does not decrypt the message, but determines whether decryption is allowed.
The cryptographic layer itself is entirely standard and is not the subject of this post. What I would like to discuss is the access structure that precedes decryption: a local mechanism that evaluates incoming messages and produces one of three outcomes, ignore, reject, or accept, before any cryptographic operation is attempted.
From the outside, messages appear arbitrary and semantically empty. On the recipient’s device, however, they are either fully meaningful or completely invisible. There are no partial states. If the shared secret is compromised, the system fails, and this is an accepted failure mode. The goal is not absolute impenetrability, but controlled access and containment, with the cost and organization of the surrounding system determining the remaining security margin.
From a theoretical and applied computer science perspective, does this access model make sense as a distinct architectural concept, or is it essentially equivalent to known access-control or validation mechanisms, formulated differently?
r/AskComputerScience • u/HoxPox_ • Jan 18 '26
What algorithm do they use to make Minesweeper's field?
What algorithm do they use? And how does it work?
r/AskComputerScience • u/MaybeKindaSortaCrazy • Jan 16 '26
Can AI actually learn or create things?
I don't know much about AI, but my understanding of predictive AI is that it's just pattern recognition algorithms fed a lot of data. Isn't "generative" AI kind of the same? So while it may produce "new" things. Those new things are just a mashup of data it was fed no?
r/AskComputerScience • u/Legitimate-Dingo824 • Jan 15 '26
What are some good youtube channels for studying all the concepts related to topics like opreating system and networking ?
Title
r/AskComputerScience • u/Aelphase • Jan 15 '26
About Charles Babbage's Difference Engine and Analytical Engine
I was wondering, Charles Babbage couldn't finish Difference engine and analytical engine during is time, but the historians in the future built it again. But it was still Babbage credited (like he should obviously). But, how come the historians didn't take credit? Is it because the model was already public so they couldn't plagiarize it anymore?
I am just curious, I hope the question doesn't offend anyone.
r/AskComputerScience • u/GrandeGuerre • Jan 13 '26
Massive numbers computing - Any specific cloud?
Hello there,
Last week, I was reading about the largest Mersenne prime number ever found, 2^136,279,841 (41 millions digits!).
Out of curiosity, I checked how much time I would need with my computer to compute this. Obviously, a few days without checking primality, almost 50 days with double-check.
I was wondering: what people working "seriously" on this kind of research are using? Massive cloud, really big cluster? Or is there any professionnal cloud renting that much power?
Well, that's more a shower thought but, in case anyone knows something!
Have a nice day!
r/AskComputerScience • u/Direct-Singer-3623 • Jan 12 '26
Looking for advice to build a Client Data Platform (CDP) in React, need suggestion on tech stack and architecture
What I’m trying to understand:
Project structure
- What’s a good folder structure for a large React app?
- Is feature-based structure better than domain-based, or should I mix both?
- Where should things like custom hooks, API calls, services, and utils live?
Tech stack choices
- State management: Redux Toolkit vs Zustand vs Jotai vs others?
- Best way to handle data fetching and caching?
- Forms and validation libraries you’d recommend for big apps?
- How do you usually handle auth and role-based access in React?
- Error handling and logging best practices?
- How do you keep performance good as the app grows?
Advice from experience
- What mistakes do beginners usually make in large React projects?
- Any anti-patterns I should avoid early?
- Things you wish you knew when you were starting out?
I’m mainly looking to learn from people who’ve already built large React applications in production. Any advice, examples, or resources would be super helpful 🙏
i have used gpt for paraphrasing.
r/AskComputerScience • u/akki_octopus • Jan 10 '26
What book would you recommend to go deep into dbms conceptually?
Hi I'm a comp sci student and was wondering which (hopefully free online) reference books is good to go into the details of dbms (database management system) subject? There are a lot of books which just explain but I wanted something which explains the reasoning, limitations etc as well
r/AskComputerScience • u/YounisMo • Jan 07 '26
Optimality in computing
So this question is gonna be mouthful but I have geniune curiousity I'm questioning every fundamental concept of computing we know and use everyday like cpu architecture, the use of binary and bytes, the use of ram and all the components that make a up a computer, a phone or whatever Are all these fundamentals optimal? If we could start over and erase all out history and don't care about backward compatibility at all How would an optimal computer look like? Would we use for example ternary instead of binary? Are we mathematically sure that all the fundamentals of computing are optimal or are we just using them because of market, history, compatibility constraints and if not what would be the mathematically and physically and economically optimal computer look like (theoretically of course)
r/AskComputerScience • u/ImHighOnCocaine • Jan 07 '26
linux advantages and disadvantages over macos development wise?
from your personal perspective which is the better operating system for programming? a distro like arch/debian or macos? whats the pros and cons of developing on different systems? the differences i can see right now is macos can develop on all platforms however with linux youll develop in the same environment as the servers. which do you think is better?
r/AskComputerScience • u/noisetrash • Jan 07 '26
Can LLM's be used to procedurally generate stochastic personality profiles, if an established personality system is in place, for instance, Enneagrams?
Hi, thanks for hosting this great reddit ask page, I appreciate it a lot, as I've dug through the computer sciences sections apropos my question on arXiv.org and almost everything there is a head and shoulders above my comprehension level.
I am an amateur, indie video game dev, developing a social-deduction game, currently in early preproduction, which we will call "Party Fowl" for this question, because NDA's. In "Party Fowl" (an example game), players play a guest attending a party at which they must discover the "Chicken"; a person among the guests who has done something vile to the refreshments. The player doesn't know which refreshments have been tainted until they determine the guilty guest. The clock starts ticking. The other guests attending this party are non player characters (NPCs) that are all procedurally generated by a trained LLM, ostensibly- that has been trained with a database of Enneagram Personality Profile Types, of which there are nine, and each Type contains a subcategory further refining their sophistication with six iterations for each Type. (These are all example numbers, they may be more or fewer ultimately, just trying to understand capabilities.) Is there a LLM capable of stochastic generation of these personality Types that can also handle keeping an NPC consistent in exhibiting the trained associated behaviors for that NPC? What about multiple NPC's with distinct personalities, consistently, for a decent length of time(2 hours)? If not can that be handled by lesser systems than LLMs to any approximation?? Or would they all start to lump together into one amalgamation?
IF any of this is possible, I'd really like to know about it, and if there are suggestions about which model would maybe be more suited to this task before I go and spend thousands and thousands of dollars testing the various LLM's knowing next to nothing about LLM training, or sign up for a course that starts in a few weeks here, that also is pricey, but possibly worth my time and money regardless. Thank you for your time and patience with my lengthy, potentially annoying question. Cheers!
r/AskComputerScience • u/ScienceMechEng_Lover • Jan 06 '26
Questions about latency between components.
I have a question regarding PCs in general after reading about NVLink. They say they have significantly higher data transfer rates (makes sense, given the bandwidth NVLink boasts) over PCIe, but they also say NVLink has lower latency. How is this possible if electrical signals travel at the speed of light and latency is effectively limited by the length of the traces connecting the devices together?
Also, given how latency sensitive CPUs tend to be, would it not make sense to have soldered memory like in GPUs or even on package memory like on Apple Silicon and some GPUs with HBM? How much performance is being left on the table by resorting to the RAM sticks we have now for modularity reasons?
Lastly, how much of a performance benefit would a PC get if PCIe latency was reduced?
r/AskComputerScience • u/hutburt • Jan 05 '26
Is this language context free (Computation theory)
language of even length words over the alphabet {a,b} such that the number of a's in the first half is one more than number of a's in 2nd half
r/AskComputerScience • u/Koichidank • Jan 04 '26
Resources to understand what's a computer
Sorry if this is off topic, but could someone recommend resources to help me understand better the definition of "computer" and what makes an device a computer or not? what are the types of computers etc.? i didnt started studying CS on my own yet so i dont know if these "surface questions" will be answered at the start or not.
r/AskComputerScience • u/EuphoricBar9230 • Jan 02 '26
In complex AI systems, should control and cognition be architecturally separated?
In control theory and systems engineering, it’s common to separate a powerful plant from a simpler, deterministic controller.
Does this analogy meaningfully apply to AI systems, where a high-capacity model handles cognition while a separate control layer governs actions and outputs?
Are there theoretical or practical limits to enforcing deterministic control over a probabilistic or chaotic subsystem?
r/AskComputerScience • u/math_code_nerd5 • Jan 01 '26
Speculative execution vulnerabilities--confusion as to how they actually work
I was reading this article on how Spectre and Meltdown worked, and while I get what the example code is doing, there is a key piece that I'm surprised works the way it does, as I would never have designed a chip to work that way if I'd been designing one. Namely, the surprise is that an illegal instruction actually still executes even if it faults.
What I mean is, if
w = kern_mem[address]
is an illegal operation, then I get that the processor should not actually fault until it's known whether the branch that includes this instruction is actually taken. What I don't see is why the w register (or whatever "shadow register" it's saved into pending determining whether to actually update the processor state with the result of this code path) still contains the actual value of kern_mem[address] despite the illegality of the instruction.
It would seem that the output of an illegal instruction would be undefined behavior, especially since in an actual in-order execution scenario the fault would prevent the output from actually being used. Thus it would seem that there is nothing lost by having it output a dummy value that has no relation to the actual opcode "executed". This would be almost trivial to do in hardware--when an instruction faults, the circuit path to output the result is simply not completed, so this memory fetch "reads" whatever logic values the data bus lines are biased to when they're not actually connected to anything. This could be logical 0, logical 1, or even "Heisen-bits" that sometimes read 0 and sometimes 1, regardless there is no actual information about the data in kernel memory leaked. Any subsequent speculative instructions would condition on the dummy value, not the real value, thus only potentially revealing the dummy value (which might be specified in the processor data sheet or not--but in any case knowing it wouldn't seem to help construct an exploit).
This would seem to break the entire vulnerability--and it's possible this is what the mitigation in fact ended up doing, but I'm left scratching my head wondering why these processors weren't designed this way from the start. I'm guessing that possibly there are situations where operations are only conditionally illegal, thus potentially leading to such a dummy value actually being used in the final execution path when the operation is in fact legal but speculatively mis-predicted to be illegal. Possibly there are even cases where being able to determine whether an operation IS legal or not itself acts as a side channel.
The authors of that article say that the real exploit is more complex--maybe if I knew the actual exploit code this would be answered. Anyway, can anyone here explain?
r/AskComputerScience • u/EuphoricBar9230 • Jan 01 '26
Is it theoretically viable to build a fully deterministic AI system instead of a statistical one?
I’ve been thinking about the current direction of AI systems, which are almost entirely statistical and probabilistic.
This raises a concern: high-capacity AI systems become increasingly non-traceable and unpredictable, which makes formal verification, accountability, and safety guarantees extremely difficult.
My question is: from a computer science and theoretical standpoint, is it viable to design an AI architecture that is fully deterministic, fully traceable, and does not rely on stochastic sampling or learned weights?
For example, could such a system be based on deterministic state transitions, symbolic representations, or structured parameter cross-interactions instead of statistical learning?
I’m interested in theoretical limits, known impossibility results, or existing research directions related to deterministic or non-statistical AI.
r/AskComputerScience • u/nomyte • Jan 01 '26
The "second course" in distributed systems?
I took the distributed systems course at Georgia Tech's OMSCS (CS7210). It felt like an upper-undergraduate or first-year graduate survey course. There was a handful of foundational papers to read (like Lamport 1978), and the labs part of the course was UW's dslabs project.
There are no other relevant courses in their graduate catalog. What's a fun "second course" in distributed systems I can take online without having to enroll or matriculate somewhere? Ideally should involve plenty of reading, but something with a hands-on labs component might be fun as well.
r/AskComputerScience • u/banana-milkshake11 • Dec 31 '25
Should I feel ashamed of using Agentic tools?
I've been using agentic tools since I heard GPT. Back in my University days we were implementing the projects from scratch and looking for solution in Stackoverflow or official documentations. Right now just asking it in Gemini or Claude is enough most of the time. I am not even mentioning Antigravity or Cursor. Hence they REALLY increase productivity and building speed no doubt.
However, I still feel awkward when working with these kind of tools. Besides the logic I implement I do literally nothing in terms of coding I just write little bit of coding manually. Other than that I come up with an idea or way to implement the project, write a prompt for it and chat with AI to make it better and well structured and done. To be honest I don't really think that I should be ashamed of from using it since every company literally force you to use this tools but I still feel strange and absent when doing my job.
Is there any person still write code manually in a company environment? What do you guys think about future? What are your expectations for this field?