Home > News and views > View all

Algorithms + data structures = programs

Published: May 17, 2017 3 min read

Dharini Krishnamoorthy

Associate Lecturer

Queen Mary University Of London

Computing

Are we focusing more on algorithms and forgetting about data structure when writing computer programs? The fact is programming revolves around data either by processing data, storing or retrieving data and more innovative algorithms have been created by organising data efficiently which results in improved performance.

"Smart data structures and dumb code works a lot better than the other way around." - Eric S. Raymond perfectly sums up the importance of data structure in programs.

In order to understand how an organised information improves performance, let us consider an example of Spit-not-no activity. Whole class activity Spit-not-so is from the CS4FN team at Queen Mary University of London which introduces a practical way to teach computing in a fun, thought provoking way away from computers.

This activity uses nine words SPIT, NOT, SO, FAT, FOP, AS, IF, IN, PAN. The aim of this game is for each player in turn to choose three random word cards and the winner of this game will be the first person to hold three words containing the same letter (e.g. NOT, PAN, IN has ‘N’). By organising information in advance we can easily win this game but how? We can arrange all winning word combinations in a list or in an array of 3x3 grid but which method will be efficient? Can the same method/algorithm be applied for the noughts and crosses game?

Recently, the problem solving approach has taken the lead role in teaching computing. We often give more importance to teaching our students on ways to solve a problem but forget the simple truth that how we handle data plays an important role in determining efficient and creative problem solving approaches.

For example, you have planned a trip to take your kids to the famous theme park Alton Towers during their Easter holidays. How can you plan effectively by looking at the Alton Towers map so you visit every possible ride within a day or two? Things to consider when planning are: age/height restrictions appropriate for your kids, waiting time in queues, suitable breaks, types of rides suited for different times of day etc.

Organising information in the form of a tree with different paths or lines branching off will greatly help not only to solve this problem but making the best use of your time in Alton Towers.

Whether it is to find a common link between people in LinkedIn network or to find the best possible route to your location in case of Tube strikes/road works, or even for playing simple toads and frogs swapping game, data needs to be organised in a way so it can be used efficiently which directly impacts the performance of algorithms and programs. 

Learning about how data is manipulated and organised will develop students’ understanding as to why some programming techniques work effectively in certain situations.

Students should be provided with more opportunities to understand the role of data structures away from the computer. Application of their understanding of data structure is the key to implement efficient and clever algorithms/programs.

You might also be interested in…