Thread: whats the next thing to learn

  1. #1
    Registered User
    Join Date
    Apr 2019
    Posts
    662

    whats the next thing to learn

    i think i have mastered linked lists as far as adding nodes to the head and tail and removing nodes printing and kind of sorting them. at least as far as creating a new sorted list and storing the nodes in order in the new list whats the next logical step

  2. #2
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,859
    Double linked lists - You will find that they are much easier to work with

  3. #3
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,859
    Also if you are looking for a few quick projects, have a look at Project Euler - They start off easy and then get harder

  4. #4
    Registered User catacombs's Avatar
    Join Date
    May 2019
    Location
    /home/
    Posts
    72
    Try automating your daily tasks with C programs.

  5. #5
    Registered User
    Join Date
    May 2019
    Posts
    214
    Maybe everything runs together on me (I'm only one my 2nd coffee), but aren't you also studying quicksort?

    Am I confusing you with someone else asking about binary trees (AVL)?

    Ok, that's from another board...so, here's the thing:

    Binary trees are a TYPE of linked list (double linked list). Instead of the "next" pointer, double linked lists have "next" and "prev". In binary trees those nodes are named "left" and "right", and the algorithms used keep the tree sorted (and require you only have unique keys - no duplicate entries). After you learn binary trees, you learn they generally degrade when they are not balanced well, after which you learn to balance the trees as part of the insert/delete algorithm. The two main balancing types are "AVL" and "Red-Black" binary trees.

    Linked lists, in the form of trees, make appearance in a number of real time applications, sometimes known as the octree, or spatial tree. The nodes don't "sort" per se, but organize data into spatial regions.

    Disk storage may include the notion of M-way trees.

    In other words, the linked list is the introduction to a wide variety of use case designs you'll find fascinating.

  6. #6
    Registered User
    Join Date
    Apr 2019
    Posts
    662
    it was me asking about quick sort as i decided to play with sorting algorithms as a rest as i spent a week trying to master singly linked lists never heard or binary trees or why one would use them

  7. #7
    Registered User
    Join Date
    May 2019
    Posts
    214
    Ah, that 3rd cup brought it all back

    Indeed, the binary tree is an important study, and it is said that the stl's map is usually implemented as a red-black tree. They are most appropriate to choose when insertions/deletions are frequent. When searching is the primary use, it is best to consider sorted arrays (searching sorted arrays is faster, and even the sorting itself is faster than building a tree).

  8. #8
    Registered User
    Join Date
    Apr 2019
    Posts
    76
    Quote Originally Posted by cooper1200 View Post
    i think i have mastered linked lists as far as adding nodes to the head and tail and removing nodes printing and kind of sorting them. at least as far as creating a new sorted list and storing the nodes in order in the new list whats the next logical step
    research howto use GUI in C,so you can also do that in C not just with VB?
    you tell me you can C,why dont you C your own bugs?

  9. #9
    Registered User
    Join Date
    Apr 2019
    Posts
    662
    do i not need to understand classes to do gui stuff?

  10. #10
    Registered User catacombs's Avatar
    Join Date
    May 2019
    Location
    /home/
    Posts
    72
    Yes.

  11. #11
    Registered User
    Join Date
    May 2019
    Posts
    214
    Quote Originally Posted by cooper1200 View Post
    do i not need to understand classes to do gui stuff?
    Yes, but that's because most modern GUI work is done with a library in C++, which itself is a collection of classes. You can become the consumer of such a library much more readily than to become the author of classes, and can even gain insight into how to design a collection of classes working toward a particular purpose by using a good GUI library. In other words, this is a bit of a paradox (a chicken/egg paradox).

    Your awareness of the struct or class you've used for the linked list is just about enough to use the C++ GUI libraries.

    If this is familiar to you:

    Code:
    MyClass a;
    MyClass b;
    
    a.somefunction( 2 );
    b.someotherfunction( 2 );
    Even though you don't see the class declaration, you probably realize that 'somefunction' must be a member of MyClass, and that whatever MyClass may be, you have an instantiation of it as variable "a", and so somefunction is being called on "a". Likewise, there is a "b" of type MyClass, and yet another member function is called on "b", and that "a" and "b" are two instantiations of MyClass.

    If that is what you understand, you're able to use the GUI libraries for simple GUI applications.

    Qt is rather popular, but I can recommend WxWidgets as a good alternative that is completely free.

    There are others, but in the 21st century these are the top two. Microsoft provided one called "MFC" for decades, but it is all but entirely limited to Windows (there was a MAC version for a few years, but it died). However, in the modern era it makes no sense to make an application that can only run on Windows, when simply choosing either Qt or WxWidgets is the same basic work, but the product runs on Windows, Linux and MAC.

    I am, however, referring to simple applications. For all higher targets of ambition, of course, you'll need to know more about designing classes and structs, using the STL, smart pointers, strings and the standard library.

    The one thing that can get in the way is downloading, installing and the initial building of the GUI library. There are instructions, and if followed precisely, and if you're using a compiler/IDE the library says is supported, you're soon running one of the example programs.
    Last edited by Niccolo; 05-31-2019 at 02:07 PM. Reason: typo fix

  12. #12
    Registered User
    Join Date
    Apr 2019
    Posts
    662
    if "myclass" is like saying struct somename a then i can see that a.data = x would assign the value of x to the member data of a which is an instance of struct somename. i think we are saying the same thing however aren't classes more complex than that with private and public members and inheritance and all that jazz. i half remember this from years ago and trying to do mfc's and giving up after copying out a program from a book on mfc's from Microsoft that didn't work. and giving up.

  13. #13
    Registered User
    Join Date
    May 2019
    Posts
    214
    There is no difference between class and struct in C++ except the default to private acces in classes vs public access in structs. Otherwise, everything, absolutely everything, without the slightest exception, that applies to classes applies to structs.

    Some go so far as to never use struct, and merely explicate public or private.

    The only other difference you can perceive is that the struct keyword was available in C, but of course there was no notion of private or public (everything was public) access, and, obviously, C had no member functions, constructors, destructors or operators.

    On another point, MFC should probably not be used as an example.

    There's a lot of jokes inside that....it was a redefinition of the term "adequate".

    That said, you may be thinking of C#. In C# there is a difference like that you suggest.
    Last edited by Niccolo; 05-31-2019 at 03:52 PM. Reason: typo

  14. #14
    Registered User
    Join Date
    Apr 2019
    Posts
    662
    where does polymorphism and inheritance come into it all then

  15. #15
    Registered User
    Join Date
    Apr 2019
    Posts
    662
    one of the reasons i went to vb many moons ago (i mean vb not vb.net) was you had a form and placed the components on the form ie a button suppose you wanted it to display a message when the user clicked it. the button had a click event and all you had to write with in the event was msgbox("hello") or whatever you wanted it to say. is this the same for c gui? obviously the syntax may be different

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I could learn a thing or to about Recursion
    By LAURENT* in forum C++ Programming
    Replies: 7
    Last Post: 11-21-2013, 09:36 AM
  2. Now whats wrong with this thing...
    By hubris in forum C++ Programming
    Replies: 5
    Last Post: 03-26-2011, 03:49 PM
  3. Replies: 7
    Last Post: 08-07-2007, 04:00 AM
  4. What's The Most Important Thing To Learn In C++?
    By DeanDemon in forum C++ Programming
    Replies: 3
    Last Post: 12-09-2002, 06:49 PM
  5. WHATS UP YALL....i want to learn
    By Unregistered in forum Game Programming
    Replies: 2
    Last Post: 02-23-2002, 04:20 PM

Tags for this Thread