reading-notes

Implementation: Linked Lists

Big O notation:

Big O notation is a mathematical notation used to describe the complexity or efficiency of an algorithm. It provides a standardized way to analyze and compare algorithms based on their worst-case scenario in terms of time and space complexity.

How is Big O notation commonly used in algorithm analysis?

Big O notation is used to classify algorithms according to how their performance scales with the input size. It provides a way to analyze and compare the efficiency of different algorithms without considering implementation details or actual running times.

The “O” in Big O notation stands for “order of.” It is used to describe the upper bound or the worst-case scenario of an algorithm’s time or space complexity.

Time complexity:

Time complexity in Big O notation represents the amount of time an algorithm takes to run as a function of the input size. It describes the upper bound or worst-case scenario for the growth rate of the algorithm’s running time as the input size increases.

Space complexity:

Space complexity in Big O notation represents the amount of memory or space required by an algorithm to solve a problem as a function of the input size. It describes the upper bound or worst-case scenario for the growth rate of the algorithm’s space usage as the input size increases.


Singly linked lists

Singly linked lists are important data structures with various applications. By understanding their structure, operations, and benefits, you can leverage them to efficiently manage and manipulate collections of data in your programs.

Why Singly Linked List?

A singly linked list is a fundamental data structure used in programming to store and manage collections of data. It provides efficient insertion and deletion operations compared to other data structures like arrays.

Cheat Sheet:

Singly linked lists are efficient for insertion and deletion operations. Nodes in a singly linked list contain a value and a reference to the next node. The last node in a singly linked list points to null. Traversing a singly linked list involves following the links from the head to the tail. To delete a node, update the link of the previous node to skip the node to be deleted. In conclusion, a linked list is a fundamental data structure in computer science. It consists of nodes linked together to form a sequence. Linked lists offer flexibility in adding or removing elements without requiring contiguous memory. Understanding linked lists helps improve knowledge of data structures and their applications. ——– Home