100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary of A-Level Computing algorithms £4.49   Add to cart

Summary

Summary of A-Level Computing algorithms

 7 views  0 purchase

All of the algorithms students need for their A-Level exam- both the pseudocode and Python code. Sorting and searching algorithms are covered in detail and fully commented.

Preview 3 out of 18  pages

  • March 21, 2022
  • 18
  • 2021/2022
  • Summary
All documents for this subject (7)
avatar-seller
MBlake247
Computer Science A-Level Notes


Binary Search
function binary_search (items, search_item, first, last)

if first > last then

return -1

else

midpoint = (first + last) DIV 2

if items[midpoint] == search_item then

return midpoint

else if search_item > items[midpoint] then

first = midpoint + 1

return binary_search (items, search_item, first, last)

else

last = midpoint - 1

return binary_search (items, search_item, first, last)

endif

endif

endfunction




Elliot Tierney Page 1

, Computer Science A-Level Notes


Binary Tree (Search)
function binary_tree_search (node, search_item)

if search_item == node.data then

return True

elseif search_item > node.data and node.right != Null then

return binary_tree_search (node.right, search_item)

elseif search_item < node.data and node.left != Null then

return binary_tree_search (node.left, search_item)

endif

return False

endfunction




Elliot Tierney Page 1

, Computer Science A-Level Notes


Bubble Sort
procedure bubble_sort(items)



#Initialise variables

num_items = items.length

temp = 0



#Pass through list n-1 times

for pass_number = 1 to num_items - 1

for index = 0 to num_items - 2

#Check if items are out of order

if (items[index] > items[index + 1]) then

#Swap items

temp = items[index]

items[index] = items[index + 1]

items[index + 1] = temp

endif

next index

next pass_number



endprocedure




Elliot Tierney Page 1

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller MBlake247. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for £4.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

84866 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy revision notes and other study material for 14 years now

Start selling
£4.49
  • (0)
  Add to cart