algorithms code

16 flashcardspar Sabs2023
Réviser ces flashcardsGratuit · répétition espacée · iPhone, Android, Mac et web

Toutes les cartes

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
Réviser les 16 cartes gratuitement

Plus de flashcards : Informatique

Computer Organization207 cartesInformatique · AnglaisTreyISDS 409: Networking Fundamentals (Chapters 1 & 3)125 cartesInformatique · AnglaisEthanConcepts of Programming Languages86 cartesInformatique · AnglaisLuluWindows Administration: Active Directory and Accounts70 cartesInformatique · AnglaisJaySection 1.1-1.3: Windows Commands/OS58 cartesInformatique · Anglaispzxlimemory 48 cartesInformatique · AnglaiserikaCS 325 T7 L4,5,641 cartesInformatique · AnglaisClementSecurity Plus Ports35 cartesInformatique · AnglaisJohnComputer Networks Part 230 cartesInformatique · AnglaisSgPt. 123 cartesInformatique · AnglaisCornyNa+- és vízháztartás zavarai18 cartesInformatique · HongroisRitikeAlgorithms itself13 cartesInformatique · AnglaisSabs2023

Tous les decks : Informatique

Révise ces decks dans l’app

Gratuit sur iPhone, Android, Mac et le web. Ajoute n’importe quel deck à ton compte en un tap.

Télécharger dans l’App StoreDisponible sur Google Play
Réviser les 16 cartes gratuitement