DATA STRUCTURES & ALGORITHMS

  1. PRIMITIVE DATA STRUCTURES: They are basic data structures for assigning values to data in python. They include: Integers (positive and negative numbers e.g. 1, 5, 38, -45); floats (decimal numbers e.g. 4.0, 3.8); strings (sequence of characters enclosed within a pair single or double quotes e.g. ‘Joshua’, “envelope”, ‘I am a boy’); boolean (these are data structures which can hold the TRUE and FALSE statements e.g. x = 7, w=3, x + w ==8, will print “FALSE”). NOTE that you can convert one data structure to another, but that is subject for another time.
  2. NON-PRIMITIVE DATA STRUCTURES: These are the more advanced members of the Data structure family. They are broadly divided into 3: Arrays, Lists and Files. Arrays are a more compact way of collecting data of t he same type together. They are more popular in C++ and Java than in python programming. Their major distinctiveness from the List data structure is that in array, the programme recognizes and treats all the individual items as the dame data type. You can learn more about arrays by clicking here. Lists are a little bit more advanced than arrays. In Lists, items of different data types can be brought together. e.g. birthNAME= [Emeka, James, Andrew, Joshua, Obodozie]. The List data structure can be further classified into Linear data structures (Stacks and Queues), and Non-linear data structures (Graphs and Trees). Files are important data strictures in programming, as any programme or programming language that cannot read files is of little or no use since the world of Big Data deals with files (.csv, .xls. .doc, etc.) Thus, being able to open, read write and work on files is an important part of programming.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store