Top answers

All subjects
All levels

Write a recursive binary search algorithm in pseudocode.

A binary search algorithm is one of the most important searching algorithm, user on sorted arrays. This algorithm searches for a given number (value) in an array A. How does the algorithm works ?1) check...

Answered by Tudor U. Computing tutor
1659 Views

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...

Answered by Vlad H. Computing tutor
710 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...

Answered by Vlad H. Computing tutor
585 Views

What is polymorphism in regards to Object Oriented Programming (OOP)? Provide an example.

The word ‘polymorphism’ literally means ‘a state of having many shapes’ or ‘the capacity to take on different forms’. When applied to object oriented programming languages like Java, it describes a langua...

Answered by Paras R. Computing tutor
1033 Views

What is inheritance in object-oriented programming?

Inheritance is a useful and powerful concept in object-oriented programming languages, such as Java and C++. Inheritance is used to provide subclasses with the same instance variables and operations as th...

Answered by Ryan F. Computing tutor
1399 Views

We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2024

Terms & Conditions|Privacy Policy