๐ŸŒ
W3Schools
w3schools.com โ€บ dsa
DSA Tutorial
The study of Data Structures and Algorithms really took off with the invention of computers in the 1940s, to efficiently manage and process data. Today, DSA is a key part of Computer Science education and professional programming, helping us ...
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ data_structures_algorithms โ€บ index.htm
Data Structures and Algorithms (DSA) Tutorial
The following computer problems can be solved using Data Structures โˆ’ ... This tutorial has been designed for Computer Science Students as well as Software Professionals who are willing to learn data Structures and Algorithm (DSA) Programming ...
Discussions

cs50x - How to properly free memory in the following W3Schools c programming code demonstrating Queue Implementation using Linked Lists - CS50 Stack Exchange
I am taking CS50x I am currently on week 5 DataStructures. I am also in the process of going through the W3Schools tutorial on DataStructures for extra practice and to get a better understanding o... More on cs50.stackexchange.com
๐ŸŒ cs50.stackexchange.com
February 22, 2024
Learning DSA from scratch : The Ultimate Guide
You forgot the DSA resource for Java: "Algorithms" by Robert Sedgewick and Kevin Wayne - Princeton University Coursera course: Part I Part II Coursebook Algorithms 4th Edition More on reddit.com
๐ŸŒ r/learnprogramming
82
420
June 20, 2023
Is it worth learn Data structures and algorithms in c?
Learn DS&A in a language with clear notation for pointers and data types. I think you can learn this in Python, but I think C is the most clear when reading an example in terms of what the types are and what is a pointer. More on reddit.com
๐ŸŒ r/C_Programming
73
120
December 1, 2023
Need advice; fairly good at C, looking to learn DSA.
I'm a 1st year college student and have been learning C for a few months. Now I'm looking to learn DSA, as recommended by someโ€ฆ More on reddit.com
๐ŸŒ r/C_Programming
32
25
January 15, 2023
๐ŸŒ
Reddit
reddit.com โ€บ r/learnprogramming โ€บ learning dsa from scratch : the ultimate guide
r/learnprogramming on Reddit: Learning DSA from scratch : The Ultimate Guide
June 20, 2023 -

DSA can be seen as three step process, A. Learn a language, B. Learn a data structure, C. Apply it in algorithms. Let's dig in shall we?

Learning a language is THE MOST asked question so, here's an answer. What language do I pick, short answer is it depends, the long of it is this. You have primarily three options,

  1. C/C++

  2. Java

  3. Python

What to pick and why? Simply speaking, most programming languages have the same skeleton just different ways of doing it. Therefore, they are used in different ways.

C++ is a powerful language which gives most of the power in your hands, this includes handling how much power or resource you would demand from a system. What kind of system memory you wish to utilise. If you have a timeline of over a year or more this is the best option for you. Though this has a long learning curve and does take time, it helps a lot in the future since almost every other language on this list has features taken from C++. Lastly, if you wish to join Competitive Programming this is the way to go.

Java is a language that falls somewhere in the middle where it's not too easy but not too frustrating as well. Most service based companies who are in the Asian belt prefer Java as a language in many of their projects. Bearing that in mind. If you're aiming for a job in a service based firm this is the way to go. The learning curve is a bit less than C++ but again the concepts are quite empowering for a programmer in their career.

Python is the kingpin that runs the Wild West that's IT these days, Python would be the ideal choice if you're a short deadline and need a job ASAP. The concepts are fewer and the language is less verbose.

Resources to learn the languages:

For C++

1 First two lectures on Harvard's CS50 (David J Malan is one of the best explainers of Intro To Programming I've ever seen)

2. W3Schools www.w3schools.com (Works great as a course material and reference)

3. www.learncpp.com (Frankly, the best place to learn imho)These should be enough for learning C++

For Java

Derek Banas has a fantastic tutorial on YT. Tim Bulchakaโ€™s Java Masterclass course (Paid Resource)Coding With John is another fabulous resource.

For Python

Corey Schafer on YT

W3Schools (Works great as a course material and reference)

The Python Tutorial on Python.Org is a good reference to work as a pair with any of the above listed resources.

So, what all must you know from a language agnostic view point,The basics - Variables, if-else, strings, loops, functions.OOPs (Object Oriented Programming) - Classes, Methods, instances, etc.

At this stage you can move on to learning Data Structures, I'll be listing the most common ones and what approaches are necessary. This is not an exhaustive list nor it is a rulebook for solving problems. Tweak and learn as per your need and adapt.

I would suggest to go through these data structures.

- Linked lists

- Stacks

- Queues

- Trees

- Graphs

- Heaps

- Hash tables

These would allow you to clear any interview or start solving competitive programming problems.

A playlist that helped me a lot for data structures was William Fiset's video

If you have taken Java as a language Princeton University's Algorithms would be the go-to resource.

Tech Interview Handbook is another resource that would be helpful.

Abdul Bari is a fantastic resource for Algorithms. His explanations are top tier.

Though in JavaScript this resource for it's logic explanations are great.

# EDIT :

MOOC is a resource I missed out on thanks to u/WingsOfReason for suggesting.

Simultaneous to this would be recommended to solve problems from sites such as HackerRank, LeetCode.

In the case for LeetCode go for Easy Problems at first then go to medium problems. Hard Problems are better suited for Competitive Problems only.

The way I used to solve problems was this, I set a timer of 20 minutes and read the problem trying to solve the problem. After the 20 mins were over, regardless of if I had solved the problem or not reading through the editorials or looking through on Google for solutions helped me see methods or logics I hadn't thought of before.

Form a habit of solving at least 2 problems a day, which helps your mind work everyday and allow you to go.

Some Tips:

Getting an error is the rule, the program running perfect is the exception. This is a mindset which would allow you to get over the hesitation of feeling incompetent and giving up. StackOverFlow, Reddit and other such resources have millions of people solving, asking problems. Which simply means you're not alone.

You can always edit bad code, a blank page is depressing anyway, Write the code once you've got a solution. You can then edit it and make it better. Writing on paper is also a great habit to have.

The better programmer keeps going one more time than the person before them.

Even the greatest programmer today once didn't know how to declare a variable.Good luck!

๐ŸŒ
Programiz
programiz.com โ€บ dsa
Learn Data Structures and Algorithms
These tutorials will provide you with a solid foundation in Data Structures and Algorithms and prepare you for your career goals. ... Whether DSA is the right choice depends on what you want to achieve in programming and your career goals.
๐ŸŒ
W3Schools
w3schools.com โ€บ c
C Tutorial
Sign In โ˜… +1 Get Certified Upgrade Teachers Spaces Bootcamps Get Certified Upgrade Teachers Spaces Bootcamps ... HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT SWIFT ANGULAR ANGULARJS GIT POSTGRESQL ...
๐ŸŒ
GitHub
github.com โ€บ larohndale โ€บ w3schools-dsa-algo-python
GitHub - larohndale/w3schools-dsa-algo-python
First, you will learn the fundamentals of DSA: understanding different data structures, basic algorithm concepts, and how they are used in programming.
Author ย  larohndale
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ c language โ€บ learn-dsa-in-c
Learn DSA in C: Master Data Structures and Algorithms Using C - GeeksforGeeks
July 26, 2025 - Deep Understanding: C language requires the programmer to implement every feature manually, which helps in understanding how data structures work at a fundamental level. Versatility: Knowledge of DSA in C can be transferred to other languages, as many modern languages are built on C-like syntax.
๐ŸŒ
W3Schools
w3schools.com โ€บ c โ€บ c_structs.php
C Structures (structs)
Sign In โ˜… +1 Get Certified Upgrade Teachers Spaces Bootcamps Get Certified Upgrade Teachers Spaces Bootcamps ... HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT SWIFT ANGULAR ANGULARJS GIT POSTGRESQL ...
Find elsewhere
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ dsa_using_c โ€บ index.htm
DSA using C Tutorial
This tutorial is designed for Computer Science graduatates as well as Software Professionals who are willing to learn Data Structures and algorithm Programming in simple and easy steps.
๐ŸŒ
W3Schools
w3schools.com โ€บ cpp โ€บ cpp_data_structures.asp
C++ Data Structures and STL
Sign In โ˜… +1 Get Certified Upgrade Teachers Spaces Bootcamps Get Certified Upgrade Teachers Spaces Bootcamps ... HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL ...
๐ŸŒ
W3Resource
w3resource.com โ€บ data-structures-and-algorithms โ€บ index.php
Learn Data Structures and Algorithms (DSA)
Learn key concepts like programming fundamentals, problem-solving, math essentials, and DSA fundamentals before diving into data structures and algorithms. Get insights into sorting, searching, graph, dynamic, and greedy algorithms.
๐ŸŒ
W3Schools
w3schools.com โ€บ dsa โ€บ dsa_intro.php
DSA Introduction
... The algorithms we will look ... Sort' algorithm is designed to sort values, and is made to work on arrays. Data structures and algorithms (DSA) go hand in hand....
๐ŸŒ
Udemy
udemy.com โ€บ development
Data Structures and Algorithms In C ( DSA )
June 7, 2025 - This Data Structures and Algorithms in C (DSA) course provides a comprehensive explanation of data structures like linked lists, stacks and queues, binary search trees, heap, searching, hashing.
Rating: 4.2 โ€‹ - โ€‹ 1.41K votes
๐ŸŒ
W3Schools
w3schools.com โ€บ dsa โ€บ dsa_theory_linkedlists_memory.php
DSA Linked Lists in Memory
DSA Examples DSA Exercises DSA Quiz DSA Syllabus DSA Study Plan DSA Certificate ... To explain what linked lists are, and how linked lists are different from arrays, we need to understand some basics about how computer memory works. Computer memory is the storage your program uses when it is running. This is where your variables, arrays and linked lists are stored. Let's imagine that we want to store the integer "17" in a variable myNumber.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ home โ€บ dsa_using_c โ€บ data structures and algorithms using c
DSA using C - Quick Guide
February 13, 2026 - Explore the fundamentals of Data Structures and Algorithms using C programming. Learn through this comprehensive quick guide with examples and explanations.
๐ŸŒ
Google Translate
translate.google.com โ€บ translate
W3Schools.com
The study of Data Structures and Algorithms really took off with the invention of computers in the 1940s, to efficiently manage and process data. Today, DSA is a key part of Computer Science education and professional programming, helping us ...
๐ŸŒ
W3Schools
w3schools.com โ€บ dsa โ€บ dsa_syllabus.php
DSA (Data Structures and Algorithms) Syllabus (Curriculum)
Introduction Bubble Sort Selection Sort Insertion Sort Quick Sort Counting Sort Radix Sort Merge Sort Linear Search Binary Search ยท DSA Euclidean Algorithm DSA Huffman Coding DSA The Traveling Salesman DSA 0/1 Knapsack DSA Memoization DSA Tabulation DSA Dynamic Programming DSA Greedy Algorithms ยท DSA Examples DSA Exercises DSA Quiz DSA Syllabus DSA Study Plan DSA Certificate ... The W3Schools Data Structures and Algorithms Tutorial is comprehensive and beginner-friendly.
Top answer
1 of 2
2

Don't modify any of their methods.

The fix is entirely in main

You free the memory createQueue allocated into newQueue by free'ing newQueue at the end. Before you do that you use the dequeue function repeatedly which will free the node's in the queue that were created by enqueue

Shame on them for providing code which leaks memory.

Your assumptions about efficiency are 100% wrong. Your assumption about you shouldn't free from those functions is correct but not for any reason you mention.

You don't want to free memory in those functions because it would defeat the purpose of the functions and it would break the program.

  1. If you delete the memory for the queue after you created it you can't use the queue.

  2. If you delete the memory for an item you put into the (now invalid queue) then the pointer points to free'd memory....

It has nothing to do with efficiency, it has to do with purpose.

You don't free something until you are done using it

That you don't understand this tells me that you need to go back and understand how pointers and memory work, you don't have the foundation to understand data structures based on this question. Also go back and re-read the entire lesson on data structures. not just looking at the code, watch the lecture read the notes.

I don't say this to sound rude, but to inform you; it doesn't sound like you understand or are able to apply almost anything you have learned so far. I would suggest going back over everything and explaining to yourself what each line of does and why it is where it is.

Queue Memory Management In A Nutshell:

  • Before every enqueue memory must be allocated, either user does it the enqueue function does it, or some of both ( this depends on what you are putting into the container).
  • Creating the queue could be done with or without a pointer, if you do it with a pointer you have to allocate it.
  • Anything you allocate, you need to destroy when you are done with it. AKA Clean up your own mess. Generally that is roughly when you remove them from the list/queue but this will vary based on the object contained in the queue. Put simply, every malloc should have a corresponding free somewhere.

If this answers your question, please click on the check mark to accept it. Please consider upvoting the answer as well if it was useful. This helps with site maintenance.

2 of 2
0

Noicely Done.Well Appreciated.

๐ŸŒ
Quora
quora.com โ€บ Is-there-any-website-like-w3schools-available-for-C++-that-gives-all-basic-to-advanced-information
Is there any website like w3schools available for C++ that gives all basic to advanced information? - Quora
Data Science Instructor at Berkeley Coding Academy (2021โ€“present) ยท Author has 59 answers and 61.9K answer views ยท 4y ยท Basically, W3schools is based on web development and other Software development skills, it is really good for that.