Thread: Flow chart for linked list

  1. #1
    Registered User
    Join Date
    Oct 2019
    Posts
    68

    Flow chart for linked list

    I'm sorry if this is a stupid question but can't create linked list on paper with pencil


    I have decided to make flow chart first for linked list . I know pointer, structure and dynamic memory allocation are the three basic features of linked list. I understand all those three but I can't figure out on paper for linked list


    I do not have any idea to create flow chart for linked list.

    somebody please help me How to represent basic block of linked list in flow chart.


    Thanks in advance.


  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,682
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Oct 2019
    Posts
    68
    Quote Originally Posted by Salem View Post
    I can get a lot of source codes but I am asking suggestion for flow chart.

    Take a look this example

    Flow chart for linked list-linked-list-jpg

    How to make flow chart for this operation

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    3,749
    I found this link by searching on "linked list pseudocode"; Likes like good pseudocode to me.

    Linked Lists: The Basics

    NOTE: This is not a website that does your homework!

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,682
    > How to make flow chart for this operation
    What operation?

    How to create it?
    How to traverse it?
    How to delete it?

    Make a flow chart of this
    while ( node != NULL ) node = node->next;

    This is at the heart of every linked list operation, because it is how you traverse the list.

    Adding, deleting, searching are just decorations of that.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Oct 2019
    Posts
    68
    Quote Originally Posted by Salem View Post
    How to create it?
    How to traverse it?
    How to delete it?

    Make a flow chart of this
    while ( node != NULL ) node = node->next;
    I know it's not complete flow chart and I need to improve it but It's my best attempt to make flow chart

    Flow chart for linked list-flow-chart-linked-list-jpg

    How to improve above flow chart any suggestion would appreciate on flow chart

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,682
    You have a backward pointing arrow to make a loop.
    You have a "False" coming out of your <> diamond to get out of that loop.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Registered User
    Join Date
    Oct 2019
    Posts
    68
    Quote Originally Posted by Salem View Post
    You have a backward pointing arrow to make a loop.
    You have a "False" coming out of your <> diamond to get out of that loop.
    okay I have corrected points

    Flow chart for linked list-flow-chart-linked-list1-jpg

    How to make it batter

  9. #9
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,682
    No it's not right at all.

    False EXITS the loop.
    True does some work, does node = node->next and jumps back to the test.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  10. #10
    Registered User
    Join Date
    Oct 2019
    Posts
    68
    Quote Originally Posted by Salem View Post
    No it's not right at all.

    False EXITS the loop.
    True does some work, does node = node->next and jumps back to the test.
    okay modified version

    Flow chart for linked list-flow-chart-linked-list1-jpg

  11. #11
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,682
    Your true loop needs to end up pointing back at the <>

    You've got it pointing back at "set pointer to the head of the list".
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  12. #12
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,740
    It's a linked list; i.e. essentially the most elementary data structure/abstract data type known to the human species. Perhaps you should buy a book. I shudder in horror trying to imagine what will happen when you get to doubly-linked lists or, god forbid, trees.

  13. #13
    Registered User
    Join Date
    Oct 2019
    Posts
    68
    Quote Originally Posted by Salem View Post
    Your true loop needs to end up pointing back at the <>

    You've got it pointing back at "set pointer to the head of the list".
    okay Now I need to draw flow chart to print node. How to go for next steps
    Flow chart for linked list-flow-chart-linked-list1-jpg

    once flow chart will complete I will try to write code

  14. #14
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,682
    Between the <> and [next] activity, you put a [work] activity box.

    Work being whatever it is you want to do with a node in your list.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Flow chart
    By SimplyNice in forum C Programming
    Replies: 5
    Last Post: 03-20-2011, 06:22 AM
  2. flow chart
    By rafay07 in forum C++ Programming
    Replies: 6
    Last Post: 04-13-2010, 12:42 PM
  3. If-Else Flow-chart Question
    By Cell in forum Tech Board
    Replies: 3
    Last Post: 02-09-2009, 06:53 AM
  4. Flow Chart
    By strokebow in forum C++ Programming
    Replies: 2
    Last Post: 11-13-2008, 08:57 AM
  5. flow chart
    By SPOOK in forum C Programming
    Replies: 0
    Last Post: 10-08-2001, 02:45 PM

Tags for this Thread