Skip to content

shreeyabhandari/Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithm

Table of Contents

  • Data Structures (Stacks and Queues)
  • Sorting algorithms, dichotomous search
  • Dictionaries
  • Arrays
  • Complexity analysis
  • Functions and procedures
  • Recursion

Data Structures

Stack is a container of objects that are inserted and removed according to the last-in first-out (LIFO) principle i.e. The last item added to the stack is the first one to be removed from the stack.
Queue is a container of objects (a linear collection) that are inserted and removed according to the first-in first-out (FIFO) principle i.e. the items are removed from the queue in exactly the same order they were added to it.

Stack Basic Operations

operation Description
create_stack create a stack
peek return the first item of the stack
push add an element to the stack
pop remove an element of the stack
is_empty check whether the stack is empty

Queue Basic Operations

operation Description
create_queue create a queue
peek return the first item of the queue
enqueue add an element to the queue
dequeue remove an element of the queue
is_empty check whether the queue is empty

Sorting

Sorting Description
Selection sort At each step, put at the right position the smallest element
Bubble Sort If a element is bigger than the next adjacent element then swap them. Repeat until no swapping
Insertion Sort Add an element to a sorted list

Dictionaries

  • A collection of unordered items that are accessed via keys and not via their position.
  • They consist of (key, value) pairs such that each possible key appears at most once.
Keys Family_Name First_Name age
Values Bhandari Shreeya 21

About

well-defined procedure that allows a computer to solve a problem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages