Back to marketplace

Software DD (Implementation: Standard Algorithms - Records)

No description yet. This curated deck is ready for daily study.

Total cards: 17•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (17)

#1
Front (Question)

Find Min Value - Pseudocode

Back (Answer)

lowest = pupils[0].mark FOR counter FROM 1 to length(pupils) IF pupils[counter].mark < lowest Lowest = pupils [counter].mark END IF END FOR From RGC Aberdeen website

#2
Front (Question)

Find Min Value - Python

Back (Answer)

def FindMin(pupils): minimum = pupils[0].mark for x in range(1,len(pupils)): if pupils[x].mark < minimum: minimum = pupils[x].mark return minimum lowmark = LinearSearch(pupils) print(“Lowest mark is “ + str(lowmark)) From RGC Aberdeen website

#3
Front (Question)

Find Min Position - Pseudocode

Back (Answer)

minpos = 0 FOR counter FROM 1 to length(pupils) IF pupils[counter].mark < pupils[minpos].mark minpos = counter END IF END FOR From RGC Aberdeen website

#4
Front (Question)

Find Min Position - Python

Back (Answer)

def findMinPos(pupils): minpos = 0 for x in range(1,len(pupils)): if pupils[x].mark < pupils[minpos].mark : minpos = x return minpos lowpos = findMinPos(pupils) print(“The lowest mark was “ + pupils[lowpos].Mark + “ by “ + pupils[lowpos].Name) From RGC Aberdeen website

#5
Front (Question)

Find Max Value - Pseudocode

Back (Answer)

highest = array[0] FOR counter FROM 1 to length(pupils) IF pupils[counter].mark > highest highest = pupils [counter].mark END IF END FOR From RGC Aberdeen website

#6
Front (Question)

Find Max Value - Python

Back (Answer)

maximum = scores[0].mark for x in range(1,len(pupils)): if pupils[x].mark > maximum: maximum = pupils[x].mark print(“Highest mark is”, maximum) From RGC Aberdeen website

#7
Front (Question)

Find Max Position - Pseudocode

Back (Answer)

maxpos = 0 FOR counter FROM 1 to length(pupils) IF pupils[counter].mark > pupils[maxpos].mark maxpos = counter END IF END FOR From RGC Aberdeen website

#8
Front (Question)

Find Max Position - Python

Back (Answer)

def findmaxvalue(pupils): maxpos = 0 for x in range(1,len(pupils)): if pupils[x].mark > pupils[maxpos].mark : maxpos = x return maxpos From RGC Aberdeen website

#9
Front (Question)

Linear Search - Pseudocode

Back (Answer)

SearchName = Input from user FOR counter FROM 0 TO length(pupils) IF array[counter].name = SearchItem Display “Item found” END IF END FOR From RGC Aberdeen website

#10
Front (Question)

Linear Search - Python

Back (Answer)

choice = input(“Please enter the name to search for: “) for counter in range(len(pupils)): if pupils[counter].name == choice: print(“Item details: “,pupils[counter].name) From RGC Aberdeen website

#11
Front (Question)

Linear Search with Found Flag - Pseudocode

Back (Answer)

choice = Input from user found = FALSE FOR counter FROM 0 TO length(array) IF array [counter].mark = choice: found = TRUE position = counter END IF END FOR From RGC Aberdeen website

#12
Front (Question)

Linear Search with Found Flag - Python

Back (Answer)

found = False choice = input(“Please enter search name: “) for counter in range(len(pupils)): if pupils[counter].name == choice: found = True position = counter if found == False: print(“No pupil found in list”) else: print(“Pupil details: “,pupils[position].name) From RGC Aberdeen website

#13
Front (Question)

Linear Search Using a Conditional Loop - Pseudocode

Back (Answer)

choice = Input from user found = FALSE counter = 0 WHILE counter <len(pupils) AND found = FALSE IF array [counter].name = choice: found = TRUE position = counter END IF counter = counter +1 END WHILE From RGC Aberdeen website

#14
Front (Question)

Linear Search Using a Conditional Loop - Python

Back (Answer)

found = False choice = input(“Enter search Name: “) while counter < len(pupils) and found == False: if pupils[counter].name == choice: found = True position = counter counter += 1 if found == False: print(“No pupil found in list”) else: print(“Pupil details: “,pupils[position].name) From RGC Aberdeen website

#15
Front (Question)

Linear Search - Conditional Loop/Function without Found flag

Back (Answer)

Another method useful for a linear search is to just return the found position, but using the value -1 as the default. That way you know that if the foundpos is still equal to -1 after you have finished traversing through the array then you haven’t found a match. def linearsearch(array): foundpos = -1 choice = input(“Please enter search name: “) while counter < len(pupils) and foundpos == -1: if pupils[counter].mark == choice: foundpos = counter counter += 1 return foundpos From RGC Aberdeen website

#16
Front (Question)

Counting occurrences - Pseudocode

Back (Answer)

SearchName = Input from user Total = 0 FOR counter = 0 TO Length(array).name IF array(counter).name = SearchName total = total +1 END IF END FOR From RGC Aberdeen website

#17
Front (Question)

Counting occurrences - Python

Back (Answer)

def countOccurences(pupils): occurences = 0 for counter in range(len(pupils)): if pupil[counter].mark >= 50: occurences += 1 return occurences amount = countOccurences(pupils) print(“There were” + str(amount) + “passes”) From RGC Aberdeen website