algorithms code

16 Karteikartenvon Sabs2023
Diese Karteikarten lernenKostenlos · Spaced Repetition · iPhone, Android, Mac & Web

Alle Karten

1
algorithm for pushing an item in a stack in psuedocode
FUNCTION is_full(top)
IF top == MAX_SIZE - 1 THEN
RETURN True
ELSE
RETURN False
ENDIF
ENDFUNCTION


FUNCTION push(stack, top, data)
IF is_full(top) == True THEN
PRINT("Stack is full")
ELSE
top = top + 1
stack[top] = data
ENDIF
RETURN top
ENDFUNCTION
2
algorithm for popping an item off a stack
FUNCTION is_empty(top)
IF top == -1 THEN
RETURN True
ELSE
RETURN False
ENDIF
ENDFUNCTION

FUNCTION pop(stack, top)
IF is_empty(top) == True THEN
PRINT ("Stack is empty - nothing to pop")
popped_item = Null
ELSE
popped_item = stack[top]
top = top - 1
ENDIF
RETURN (popped_item, top)
ENDFUNCTION
3
how to enque item in queue
4
how to deque an item in queueu
5
how to traverse a linked list algoirthm
6
how to insert an item in a linked list algorithm(this code for how we implemented list)
7
how to delete nofde (.next = pointer)
8
linear search implentn
9
pre order traversal
10
inorder
11
postorder
12
binary search algorithm
13
bread
14
bubble sort
15
16
merge sort........AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Alle 16 Karten kostenlos lernen

Mehr Karteikarten: Informatik

Computer Organization207 KartenInformatik · EnglischTreyISDS 409: Networking Fundamentals (Chapters 1 & 3)125 KartenInformatik · EnglischEthanConcepts of Programming Languages86 KartenInformatik · EnglischLuluWindows Administration: Active Directory and Accounts70 KartenInformatik · EnglischJaySection 1.1-1.3: Windows Commands/OS58 KartenInformatik · Englischpzxlimemory 48 KartenInformatik · EnglischerikaCS 325 T7 L4,5,641 KartenInformatik · EnglischClementSecurity Plus Ports35 KartenInformatik · EnglischJohnComputer Networks Part 230 KartenInformatik · EnglischSgPt. 123 KartenInformatik · EnglischCornyNa+- és vízháztartás zavarai18 KartenInformatik · UngarischRitikeAlgorithms itself13 KartenInformatik · EnglischSabs2023

Alle Decks: Informatik

Lerne diese Decks in der App

Kostenlos auf iPhone, Android, Mac und im Web. Füge jedes Deck mit einem Tipp zu deinem Konto hinzu.

Laden im App StoreJetzt bei Google Play
Alle 16 Karten kostenlos lernen