Technically indexes and pointers are not the same thing, but in certain circumstances they can be considered the same for naming purposes (imprecise/sloppy). In the diagram below there are two list indexes (A and B). In this circumstance you might use the name index and pointer interchangeable.
Given the diagram above (list and pointers/indexes), find all of the integer pairs that sum to 6.
Use the following algorithm (The list must be sorted in ascending order)
Turn the algorithm into a function. Turn it into a generator?
Write a program that calls the function with the information above. Print each pair and the total number of pairs.
Question: Why must the list be sorted for this algorithm?
Create a program that allows a user to enter a list and a target sum.
Questions:
Given a string, use two pointers/indexes to find the longest sequence of the same character. Display the character and its location in the list.
For example:Create a program that allows a user to enter a string. Find the longest substring matching a single character. Display the character and its location.
See Project #3.
Do the same thing but find the longest sequence of non-matching characters.
Create a program that allows a user to enter a string. Find the longest substring of non-matching characters. Display the characters and their location in the list.