Update appNew update is available. Click here to update.
About
Govind Ballabh Pant Institute of Engineering & Technology, Ghurdauri 2025
My Stats
EXP gained
yellow-spark
10328
Level
7 (Expert)
Community stats
Discussions
0
Upvotes
0
Know more
127
Total problems solved
76
Easy
47
Moderate
4
Hard
0
Ninja
Jan Jan Feb Feb Mar Mar Apr Apr May May Jun Jun Jul Jul Aug Aug Sep Sep Oct Oct Nov Nov Dec Dec

Current streak:

0 days

Longest streak:

12 days

Less

More

Achievements
3
Ronin
Topics
Binary Search
Strings
+ 1 more
1
Samurai
Topics
Arrays
Discussions
Easy C++ Solution
Interview problems

Node* constructDLL(vector<int>& arr) {

    // Write your code here

    Node* head=new Node();

    Node* ptr = head;

    Node* preptr;

    for(int i=0;i<arr.size()-1;i++){

        head->data = arr[i];

        preptr= head;

        head->next = new Node();

        head = head->next;

        head->prev = preptr;

    }

    head->data = arr[arr.size()-1];

    head->next = NULL;

    head->prev = preptr;

    return ptr;

}

profile
Tanishka Petwal
Published On 11-Sep-2023
198 views
0 replies
0 upvotes
C++ easiest Solution// Easy to understand
Interview problems

Node* insertAtFirst(Node* list, int newValue) {

    // Write your code here

    Node* head = new Node();

    head->data = newValue;

    head->next=list;

    return head;

}

profile
Tanishka Petwal
Published On 11-Sep-2023
136 views
0 replies
3 upvotes