From 64e048bfac4e9a5efd3c002e93f2239ee4f61d51 Mon Sep 17 00:00:00 2001 From: guy-car Date: Fri, 30 May 2025 16:06:36 -0400 Subject: [PATCH] completed light cs section --- computer-science/light-cs/answers/guillaume.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 computer-science/light-cs/answers/guillaume.md diff --git a/computer-science/light-cs/answers/guillaume.md b/computer-science/light-cs/answers/guillaume.md new file mode 100644 index 0000000..725bb4e --- /dev/null +++ b/computer-science/light-cs/answers/guillaume.md @@ -0,0 +1,14 @@ +What is time complexity? +Time complexity measures how the runtime of an algorithm grows as the input size increases. It's expressed using Big O notation (like O(n), O(log n), O(n²)) to describe the worst-case scenario. It helps compare algorithm efficiency regardless of hardware or implementation details. + +What is space complexity? +Space complexity measures how much additional memory an algorithm uses as the input size increases. Like time complexity, it's expressed in Big O notation and includes both auxiliary space used by the algorithm and the space needed to store the input. + +What is a pointer and reference? +A pointer is a variable that stores the memory address of another variable, allowing indirect access to that variable's value. A reference is an alias for an existing variable - it's another name for the same memory location. Pointers can be reassigned and may be null, while references must be initialized and cannot be changed. + +What is a data structure? What are the types of data structures? +A data structure is a way of organizing and storing data to enable efficient access and modification. Types include linear structures (arrays, linked lists, stacks, queues) and non-linear structures (trees, graphs, hash tables). They can be primitive (integers, characters) or non-primitive (arrays, objects). + +What is a call stack? Why is it important? +A call stack is a data structure that tracks function calls in a program. When a function is called, it's pushed onto the stack; when it returns, it's popped off. It's important because it manages function execution order, stores local variables and return addresses, and helps with debugging by showing the sequence of function calls that led to an error. \ No newline at end of file