Top answers

All subjects
All levels

Given two strings s1 and s2 return the location of each permutation of the s1 string within the s2 string.

Solution: Iterate through s2 and select blocks of characters of length equal to that of s1 (for simplicity let's call this block string ref). Now, check if ref is a per...

VH
Answered by Vlad H. Computing tutor
1086 Views

Find a given element m in a list of n sorted numbers, with time complexity O(log(n))

An implementation of the Binary Search algorithm will be sufficient. The algorithm works as follows:Position on the middle element in the list of numbers. If the current number is equal to the given numbe...

VH
Answered by Vlad H. Computing tutor
949 Views

Convert 10101101 from binary to both decimal and hexadecimal

Decimal : 173 Hexadecimal : AD

EB
Answered by Emma B. Computing tutor
2337 Views

A common construct found in many algorithms is a loop. Using pseudocode, write a pre-condition loop to output all of the even numbers between 99 and 201.

Key points when answering questions are the marks given for it and how the question is defined. In this example we need to write a pre-condition loop to output all the

SA
3071 Views

Convert 'A1' hexadecimal value into binary.

Firstly split the number into 2 since there are two numbers. A and 1. We first convert 'A' into decimal. The corresponding value is 10. We then convert 10 into binary which is 1010. That is the first part...

JL
Answered by Jazir L. Computing tutor
7217 Views

We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

MyTutor is part of the IXL family of brands:

© 2025 by IXL Learning