Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

On Xcode, using Swift. I want to take an english word from a textbox and search for it in an array of objects containing an

On Xcode, using Swift. I want to take an english word from a textbox and search for it in an array of objects containing an attribute of the word. For example...

struct Word { var arabic: String = "something in arabic" var english: String = "something" }

var Apple = Word()

I'm going to have many english words with corresponding arabic words, so I want to do a binary search when the user types an english word in a text box to find the arabic version of it. When Apple.english is typed, I need to find Apple.arabic. So I need a binary search to search through all Word objects and looking at the .english attribute of each word object, if found it spits the corresponding .arabic attribute of the same Word object.

Help would be greatly appreciated!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions