Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

Do I need to learn matrix pointers in order to understand linked list in order to understand mit course

I am doing self study
I am have done php and wanted to learn mit course to learn computer science instead of programming.

http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/unit-1/lecture-6-recursion/
recommended in further study: linked list:
http://beastie.cs.ua.edu/cs150/book/index_16.html

I did not understand linked list which may not even be required to learn the mit computer science course; linked list is 'further study'

So I watched
Introduction to linked list
In this lesson, we have described linked list data structure. We have analyzed our limitations with array data structure and tried to understand the need for linked list.
https://www.youtube.com/watch?v=NobHlGUjV3g
This video about linked list allows me to understand pointers and references much better

But it is recommended by the author to watch the entire pointer lesson


Pointers in C/C++
Pointers is one concept that does not go well with beginners. In this series of videos, we will try to demystify pointers.
https://www.youtube.com/playlist?list=PL2_aWCzGMAwLZp6LMUKI3cc7pgGsasm2_

https://www.experts-exchange.com/questions/28504452/Learning-a-tutorial-but-memorizing-a-keep-concept-instead-of-understanding.html
The hardest part of C, IMO, is pointers and multidimensional pointers.

So I am learning matrix of pointers which I do not understand.



Problem:
Do I need to learn matrix pointers in order to understand linked list in order to understand mit course
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Hi RGB,

The term "matrix pointers" isn't universal.  It can mean a pointer to a matrix, or a matrix of pointers.  If you have a basic understanding of pointers, it's an incremental step to understanding either of these concepts.

As you know, a pointer is simply a memory address.  In C, a pointer variable contains the memory address of something that the program tracks.  It could be an integer, a string, a name, a table, a structure, etc.

So a pointer to a matrix looks very much like any other pointer.

  int Matrix [10][5];

  void *
  MatrixFunction (int F[10][5])
  { return F[0][0]; }

The function is called with one parameter.  That parameter is the address of a matrix.


A matrix of pointers is completely different.  It's much more common with strings (character arrays) than with integers.  If you had a table of first name and last name, each column will have to be large enough to contain the longest name that can occur in the table.  With a matrix of pointers, each item in the matrix is the size of a pointer and each pointer locates the string (array of characters) for that item.

  char *Names[10][2];

  Names[0][0] = "First Name 1";
  Names[0][1] = "Last Name 1"
  Names[1][0] = "First Name 2";
  Names[1][1] = "Last Name 2"

The matrix now contains 4 pointers for the 2 first and last name entries.
Avatar of rgb192

ASKER

Okay, I am not asking for a tutorial on matrix pointers because I can barely understand long videos. My question is do I need to learn matrix pointers to learn link lists to learn the computer science mit course
ASKER CERTIFIED SOLUTION
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

A linked list is a series of objects, each with one or more scalar pointers to another object of the same type.  It's not necessary to know anything about matrices to understand linked lists.
Thanks.