Array
Big-O
Struct
Linked List
1

What is an array in C programming?

A collection of elements of the same data type stored in continuous memory.

1

What is Big O notation used for in computer science?

To describe how an algorithm's running time grows as the input gets larger

1

Which symbol is used to access members of a struct variable?

. (dot)

1

What does each node in a linked list contain?

Data and a pointer to the next node

2

What is a two-dimensional (2D) array in C?

An array of arrays, often used to store data in rows and columns

2

Which time complexity represents linear growth as input size increases?

O(n)

2

What is the main advantage of using structures in C?

To group different data types into a single unit

2

What happens when we delete the head node of a linked list?

The second node becomes the new head

3

If a 2D array is declared as int a[3][4], how many total elements does it have?

12

3

Why do computer scientists use Big O notation instead of just measuring how long a program takes to run?

Because Big O shows how performance changes as input size grows, not just the time on one computer.

3

Which operator is used to access members when using a pointer to a struct?

->

3

What is the time complexity to delete or update an element in a linked list?

O(1)

4

Why is it useful to store data in an array instead of using many separate variables?

Because arrays let you group similar data together and access them with a single name.

4

You test two search algorithms. One is O(log n) and the other is O(n). Which one will usually be faster for very large inputs, and why?

O(log n), because it cuts the problem down much faster.

4

How do you declare a variable 'p1' of type struct Person?

struct Person p1;

4

Which of the following is a benefit of linked lists over arrays?

Easier insertion and deletion without shifting elements

5

What will be the output of the following C program?

#include <stdio.h>
int main() {
    int arr[5] = {2, 4, 6, 8, 10};
    printf("%d", arr[2]);
    return 0;
}

6

5

Two algorithms can solve the same problem. One runs in O(n) and the other runs in O(log n). Which one would you choose for very large inputs, and why?

O(log n), because it grows much more slowly as the input gets bigger.

5

If 'struct Person p1;' is declared, how do you assign 25 to its age field?

p1.age = 25;

5

How are linked list nodes stored in memory compared to arrays?

Linked lists store nodes wherever free memory is available