Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The given information regarding ll has been added #370

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,65 @@ int main()
}

```
## linked List

A linked list is an ordered set of data elements, each containing a link to its successor (and sometimes its predecessor)

The basic operations associated with linked list are-:
Insertion − Adds an element at the beginning of the list.
Deletion − Deletes an element at the beginning of the list.
Display − Displays the complete list.
Search − Searches an element using the given key.
Delete − Deletes an element using the given key.

```c

#include <bits/stdc++.h>
using namespace std;

class Node {
public:
int data;
Node* next;
};

// This function prints contents of linked list
// starting from the given node
void printList(Node* n)
{
while (n != NULL) {
cout << n->data << " ";
n = n->next;
}
}
int main()
{
Node* head = NULL;
Node* second = NULL;
Node* third = NULL;

// allocate 3 nodes in the heap
head = new Node();
second = new Node();
third = new Node();

head->data = 1; // assign data in first node
head->next = second; // Link first node with second

second->data = 2; // assign data to second node
second->next = third;

third->data = 3; // assign data to third node
third->next = NULL;

// Function call
printList(head);

return 0;
}

```

## Stacks

Stacks are a type of container adaptors with LIFO(Last In First Out) type of working, where a new element is added at one end (top) and an element is removed from that end only.
Expand Down
21 changes: 21 additions & 0 deletions javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,24 @@ throw "Error message"; // throw error text to user
|g| Performs a global match and finds all|
|i| Performs case-insensitive matching|
|m| Performs multiline matching|

## Closures

A closure is the combination of a function bundled together (enclosed) with references
to its surrounding state (the lexical environment). In other words, a closure gives you
access to an outer function's scope from an inner function. In JavaScript, closures are
created every time a function is created, at function creation time.

### Example
```javascript
function makeFunc() {
const name = 'Mozilla';
function displayName() {
console.log(name);
}
return displayName;
}
const myFunc = makeFunc();
myFunc();
```

7 changes: 7 additions & 0 deletions linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ tar -zcvf foo.txt.tar.gz foo.txt
tar -xvf foo.txt.tar.gz

```
## Text Editor Options for Programmers

```c
Sublime Text Atom GNU Emacs
Vim Gedit Notepadqq
Nano VsCode Brackets
```