Docsity

C Programming for Engineers: Lecture 22 - Data Structures and Dynamic Memory Allocation, Study notes of Engineering

Partial preview of the text

Download C Programming for Engineers: Lecture 22 - Data Structures and Dynamic Memory Allocation and more Study notes Engineering in PDF only on Docsity!

CSE294A

Introduction to C Programming for Engineers

Lecture

Jeffrey Miller, Ph.D.

C Data Structures

Data structures consist of one or more variablesthat are logically related to each other - There is usually a set of functions available tooperate on the data too - We have already talked about one such structure - Array – all of the elements in an array are of the sametype and are stored consecutively in memory

Linked List

A linked list is a linear collection of self-referential structures (called nodes),connected by pointer links struct node { int data; struct node *next_node; } struct linked_list { struct node *start_node; }

Stack/Queue

A stack is a constrained version of a linkedlist, though it is a LIFO data structure

A queue is a constrained version of a linkedlist, though it is a FIFO data structure

Homework

Homework #8 is posted!