0% found this document useful (0 votes)
34 views

Stack and Queue in Data Structure

Logeshwaran.A presented on ordered lists in data structures. Ordered lists arrange elements in a specific order based on criteria like insertion order or element properties. Common examples of ordered lists include arrays, linked lists, stacks, queues, and sorted arrays. Arrays allow direct access in O(1) time but insertion and deletion can be less efficient. Linked lists use nodes connected by pointers and traversal takes O(n) time. Stacks follow LIFO order and are useful for functions, while queues follow FIFO order and are useful for scheduling. Sorted arrays maintain elements in sorted order and allow efficient O(log n) searches.

Uploaded by

22itu218
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Stack and Queue in Data Structure

Logeshwaran.A presented on ordered lists in data structures. Ordered lists arrange elements in a specific order based on criteria like insertion order or element properties. Common examples of ordered lists include arrays, linked lists, stacks, queues, and sorted arrays. Arrays allow direct access in O(1) time but insertion and deletion can be less efficient. Linked lists use nodes connected by pointers and traversal takes O(n) time. Stacks follow LIFO order and are useful for functions, while queues follow FIFO order and are useful for scheduling. Sorted arrays maintain elements in sorted order and allow efficient O(log n) searches.

Uploaded by

22itu218
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

DATA STRUCTURES PRESENTATION

TOPIC: ORDERED LIST IN DATA


STRUCTURES

NAME : LOGESHWARAN.A
REG NO : 22ITU218
CLASS : II BSC IT D
DATE : 03/11/2023
ORDERED LIST:
An ordered list , in the context of data structures , typically refers to a linear
data structure where elements are arranged in a specific order. This order can be
based on various criteria , such as the order in which elements were added or specific
properties of the elements .

COMMON EXAMPLES OF ORDERED LIST :


1. ARRAY
2. LINKED LIST
3. STACK
4. QUEUE
5. SORTED ARRAY
1. ARRAY :
• An array is a simple ordered list where elements are stored in
contiguous memory locations , and their positions are determined
by their index

• Access time for elements is o(1) because you can directly access
an element by its index.

• Insertion and deletion can be less efficient , especially for large


arrays , because elements may need to be shifted to accommodate
changes .
2 . LINKED LIST :

• In a linked list , elements are sorted in nodes , and other is


defined by the sequence of nodes and their connections .

• Consists of nodes where each node contains data and a reference


(pointer) to next node .

• Traversing a linked list may take O(n) time , where n is the


number of elements .
3 . STACK :
• A stack is an ordered list that follows the last-in- first-
out (LIFO) order, where the most recently added
element is the first one to be removed .

• Making it suitable for tasks like function call


management and undo functionally .

• Push(insert) and pop(remove) operations are typically


O(1) operations .
4 . QUEUE :
• A queue is an ordered list that follows the first-in-first-out
(FIFO) order , where the first element added is the first one
to be removed .

• Making it suitable for tasks like task scheduling and


breadth-first search algorithms .

• Enqueue(insert) and dequeue (remove) operations are


typically O(1) operations .
5 . SORTED ARRAY :
• An array that maintains its elements in sorted order . When
you insert an element , it is placed in the appropriate
position to maintain the order .

• Elements are typically sored in ascending or descending


order .

• Searching for an element is efficient using binary search


which is O(log n) .

You might also like